# PostgreSQL to CSV Action

The *PostgreSQL to CSV* action allows you to **transfer a table from a PostgreSQL source, configured in your Connectors, directly into a Project bucket.** The data from your PostgreSQL table will be stored in a comma-separated values (CSV) file format within your chosen object storage bucket.

*   [Configure a PostgreSQL to CSV action](#configure-a-postgresql-to-csv-action)
    *   [Choose a PostgreSQL Table](#choose-a-postgresql-table)
    *   [Select Destination Bucket and Path](#select-destination-bucket-and-path)
*   [Verify Your Transfer](#verify-your-transfer)

---

## Configure a PostgreSQL to CSV action

To create a new *PostgreSQL to CSV* action, follow these steps within the Data Processing Engine (DPE):

1.  Navigate to the **Action tab** within the Data Processing Engine (DPE) interface.
2.  Click on the **"New Action"** button.
3.  From the list of available actions, select **"PostgreSQL to CSV"**.
![postgresql-to-csv-choose-table](picts/postgresql-to-csv-1.png)

### Choose a PostgreSQL Table

First, you need to select the specific PostgreSQL table you wish to transfer.

1.  A list of available tables from your connected PostgreSQL sources in the [Connectors](/en/product/connectors/sources/index) will be displayed.
2.  **Important:** If this list is empty, it means you do not have any PostgreSQL sources connected or configured in your Connectors. Please ensure you have added and connected your PostgreSQL database as a source before attempting to use this action.
3.  Select the desired PostgreSQL table from this list.
![postgresql-to-csv-choose-table](picts/postgresql-to-csv-2.png)

### Select Destination Bucket and Path

Next, you will define the destination bucket and the folder path where your CSV file(s) will be stored.

1.  **Choose Destination Bucket:** Select an available [Project bucket](/en/product/lakehouse-manager/buckets/index.md) from the list where your CSV file(s) will be stored.
![postgresql-to-csv-choose-table](picts/postgresql-to-csv-3.png)
2.  **Specify Folder Path:** In the field below the destination bucket selection, you will specify the desired folder path within the bucket.
    *   **Example:** If you want your data to be stored in a folder named `my_postgres_data` inside an `analytics` directory, you would enter `analytics/my_postgres_data/`.
    *   The system will automatically create any necessary folders if they don't already exist in the specified path.
    *   **File Naming Convention:** The exported data will always be stored in one or more files named `part-1.csv`, `part-2.csv`, and so on, depending on the size of your table.
    *   **Default Behavior:** If you leave the folder path empty, the action will, by default, create a folder named after the PostgreSQL table you selected (e.g., if your table is named `products`, it will create a `products/` folder at the root of the bucket). Within this default folder, the data will be stored as `part-1.csv`, `part-2.csv`, etc.
3.  **Run the Action:** Once both your PostgreSQL table and destination are configured, click the "Run" button to initiate the transfer.
![postgresql-to-csv-choose-table](picts/postgresql-to-csv-4.png)

---

## Verify Your Transfer

After the *PostgreSQL to CSV* action completes successfully, you can visually confirm the transfer by navigating to the **Buckets** section within the [Lakehouse Manager](/en/product/lakehouse-manager/buckets/index.md). Here, you will find your new CSV file(s) at the specified path within your destination bucket.
![postgresql-to-csv-choose-table](picts/postgresql-to-csv-5.png)

---

## Need help? 🆘

> At any step, you can create a ticket to raise an incident or if you need support at the [OVHcloud Help Centre](https://help.ovhcloud.com/csm/fr-home?id=csm_index). Additionally, you can ask for support by reaching out to us on the Data Platform Channel within the [Discord Server](https://discord.com/channels/850031577277792286/1163465539981672559). There is a step-by-step guide in the [support](#en/support/index.md) section.