# CSV to PostgreSQL Action

The *CSV to PostgreSQL* action allows you to **ingest data from a CSV file (sourced from any compatible connection in your Connectors) into a table within a PostgreSQL database.** By default, this action appends data to an existing table, with an explicit option to entirely overwrite its contents.

*   [Configure a CSV to PostgreSQL action](#configure-a-csv-to-postgresql-action)
    *   [Choose a CSV File for Transfer](#choose-a-csv-file-for-transfer)
    *   [Select Destination PostgreSQL Table and Options](#select-destination-postgresql-table-and-options)
*   [Verify Your Transfer](#verify-your-transfer)

---

## Configure a CSV to PostgreSQL action

To create a new *CSV to PostgreSQL* 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 **"CSV to PostgreSQL"**.
![csv-to-postgresql-choose-csv](picts/csv-to-postgresql-1.png)

### Choose a CSV File for Transfer

First, you need to select the specific CSV file you wish to transfer. This list will comprise CSV files accessible from **all compatible sources** configured in your Connectors.

1.  You will be presented with a unified list of available CSV files. These files are drawn from all [Connectors sources](/en/product/connectors/sources/index) that contain CSV data.
2.  Browse or search through this list to locate the CSV file you want to transfer.
![csv-to-postgresql-choose-csv](picts/csv-to-postgresql-2.png)
3.  Select the desired CSV file.
4.  **Choose Delimiter (Optional):** You can specify the delimiter used in your CSV file. By default, the system will attempt to **auto-detect** the delimiter. Alternatively, you can explicitly select one of the following common delimiters: `,` (comma), `;` (semicolon), or `|` (pipe).
![csv-to-postgresql-choose-csv](picts/csv-to-postgresql-3.png)

### Select Destination PostgreSQL Table and Options

Next, you will define the target PostgreSQL table and how the data should be loaded. You will see a consolidated list of all tables from all connected PostgreSQL sources.

![csv-to-postgresql-choose-csv](picts/csv-to-postgresql-4.png)

1.  **Select Destination Table:** You will see a comprehensive list of all PostgreSQL tables available across all your connected PostgreSQL [Connectors sources](/en/product/connectors/sources/index).
    *   For easier identification, the **name of the PostgreSQL source** will be mentioned below each table name.
    *   **Limitation:** Currently, this action supports pushing data only into **existing tables** in your PostgreSQL database.
    *   **To load into a new table:** You must first create an empty table in your PostgreSQL database (using your preferred PostgreSQL client or tools) and then select it from this list.
2.  **Loading Option:** By default, the action will **append** the new data from your CSV file to the selected PostgreSQL table.
    *   You will also have an explicit option to **Overwrite** the table. If selected, this will completely delete all existing data from the chosen PostgreSQL table before inserting the new data from your CSV file. Use this with extreme caution, as it will erase all previous data in that table.
3.  **Run the Action:** Once your CSV file, destination PostgreSQL table, and loading option are configured, click the "Run" button to initiate the transfer.
![csv-to-postgresql-choose-csv](picts/csv-to-postgresql-5.png)

---

## Verify Your Transfer

After the *CSV to PostgreSQL* action completes successfully, you can verify the transfer by connecting to the respective PostgreSQL database (e.g., using a SQL client) and querying the destination table to confirm the presence and correctness of the loaded CSV data.

---

## 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.