# PostgreSQL

Frends offers seamless integration with [PostgreSQL database](https://www.postgresql.org), enabling you to effortlessly connect and automate data flows involving PostgreSQL databases.

Frends provides tasks for performing all core PostgreSQL operations.

By leveraging Frends' task-based approach, you can configure and customize PostgreSQL integrations according to your specific requirements. Frends offers a wide range of tasks that facilitate integrations to a variety of systems and protocols.

## Use cases

Below you will find typical use cases for PostgreSQL integrations and how they are implemented in Frends.

### Get data from the database and save as CSV

By using the [`ExecuteQuery`](https://docs.frends.com/tasks/tasks/postgresql/executequery) task, we can create an integration that retrieves data from a PostgreSQL database and generates CSV exports for further processing.

<figure><img src="https://2096450325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FevBo49UTUjEN84O2WPl6%2Fuploads%2Fgit-blob-c062df604204b0fba55532cf4d6664f995582f7b%2Fpostgresql-export.svg?alt=media" alt=""><figcaption><p>Export</p></figcaption></figure>

### Insert data to database

By using the file trigger and the [`ExecuteQuery`](https://docs.frends.com/tasks/tasks/postgresql/executequery) task, we can create an integration that listens for incoming CSV files and inserts the data into the appropriate table in a Microsoft SQL database.

<figure><img src="https://2096450325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FevBo49UTUjEN84O2WPl6%2Fuploads%2Fgit-blob-3f9ca75d9d12e946a2168c96008af56002348f4e%2Fpostgresql-insert.svg?alt=media" alt=""><figcaption><p>Insert</p></figcaption></figure>
