Skip to content
Guide · pgAdmin

How to Import CSV in pgAdmin

pgAdmin imports CSV files through its Import/Export Data dialog, which copies rows from a file into an existing PostgreSQL table. This guide follows the pgAdmin documentation: create the target table, fill in the General, Options and Columns tabs, run the import and check it, with a small sample CSV you can copy and the SQL COPY alternative.

Steps and facts checked 8 October 2026 against the vendor's official documentation. Versions covered: pgAdmin 4 v9.18; PostgreSQL 18 (On Error needs PostgreSQL 17 or later). Next review due April 2027. Menus, shortcuts and prices change between releases; check the vendor's documentation for your version.
Short answer
  • pgAdmin imports a CSV into a table that already exists; create the table first with matching columns.
  • Select the table, choose Tools > Import/Export Data..., set the switch to Import, pick the file, choose the csv format and turn Header on if the first row holds column names.
  • From PostgreSQL 17, the On Error option can skip rows that fail type conversion instead of stopping the whole import.
  • In server mode (including Docker), the file must be on the pgAdmin server, so upload it with the Storage Manager first.
How we know: Research-based: the dialog tabs, fields and version notes were checked against the pgAdmin 4 9.18 documentation (Import/Export Data Dialog, Menu Bar, Storage Manager and FAQ), and COPY behaviour against the PostgreSQL 18 COPY reference, on 8 October 2026. We have not run this import for the page; the sample CSV and SQL are examples for you to try.

Before you start: pgAdmin import CSV checklist

The Import/Export Data dialog copies data from a file into a table (or from a table into a file). It does not create the table, so you need one whose columns match the CSV. Save the sample below as customers.csv in UTF-8, and create the table in the Query Tool.

Sample CSV file: customers.csv
full_name,email,signup_date
Ana Silva,ana@example.com,2026-01-15
Ben Okafor,ben@example.com,2026-02-03
"Chen, Li",li.chen@example.com,2026-03-21
Dara Murphy,,2026-04-02
PostgreSQL: target table for the sample
CREATE TABLE customers (
    customer_id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    full_name   text NOT NULL,
    email       text,
    signup_date date
);

Import a CSV file into a table, step by step

  1. In the Object Explorer, expand the database and schema and select the customers table.
  2. Choose Tools > Import/Export Data....
  3. On the General tab, move the Import/Export switch to Import (the default).
  4. In Filename, type the path or click the browse icon (ellipsis) to pick customers.csv.
  5. Set Format to csv and Encoding to the file's encoding, for example UTF8.
  6. On the Options tab, move Header to Yes so the first row is treated as column names, and check that Delimiter is a comma and Quote is a double quote.
  7. On the Columns tab, remove customer_id from Columns to export/import, because the CSV has no value for it and the identity column fills it.
  8. Click OK. pgAdmin runs the import as a background process and shows a notification when it completes; View Processes opens the Process Watcher with the command and its output.

Check the result with SELECT * FROM customers; in the Query Tool. In the sample, Dara Murphy's empty email arrives as NULL, because an unquoted empty value is the default null string in CSV format.

Import options explained

Import/Export Data dialog fields that matter for CSV imports
Field (tab)What it does
Header (Options)Treats the first line as column names and skips it
Delimiter (Options)Column separator; comma for CSV, or colon, semicolon, vertical bar or tab
Quote and Escape (Options)Quoting character (single or double quote) and the character placed before a quote inside a value
NULL String (Options)The text that represents NULL in the file
Default String (Options)Text that means "use the column default"; PostgreSQL 16 and later
On Error (General)stop (default) fails the import; ignore skips rows that fail type conversion; PostgreSQL 17 and later
Log Verbosity (General)default or verbose messages when On Error is ignore; PostgreSQL 17 and later
NOT NULL columns / NULL columns (Columns)Do not match the null string for chosen columns, or match it even when quoted

Where the CSV file must be (desktop vs server mode)

pgAdmin uses its own file dialog rather than the operating system's. In desktop mode it browses your local files. In server mode, which includes the Docker image and web installs, files are read from and stored on the pgAdmin server, so a CSV on your laptop is not visible until you upload it. Open Tools > Storage Manager, use Upload to put the file in your storage directory, then pick it in the Filename field.

Alternative: COPY and \copy in SQL

For repeatable imports, use SQL. COPY ... FROM 'file' reads a file on the database server, so the server must be able to see it and you need superuser rights or the pg_read_server_files role. The psql meta-command \copy reads the file from the client instead; you can run it in pgAdmin's PSQL Tool (Tools menu). HEADER MATCH makes PostgreSQL check that the header names match the table columns, in order.

PostgreSQL: server-side COPY and client-side \copy (psql)
-- File on the database server (superuser or pg_read_server_files):
COPY customers (full_name, email, signup_date)
FROM '/var/lib/postgresql/import/customers.csv'
WITH (FORMAT csv, HEADER true);

-- File on your machine, from psql or the pgAdmin PSQL Tool (one line):
\copy customers (full_name, email, signup_date) FROM 'customers.csv' WITH (FORMAT csv, HEADER true)

Common import errors and fixes

  • A value does not fit the column type. A value does not convert to the column's type, often a date in another format or a header row imported as data. Turn Header on, fix the data, or on PostgreSQL 17 and later set On Error to ignore to skip bad rows.
  • Too many or too few columns. The CSV has a different number of columns from the selection on the Columns tab, or the delimiter is wrong.
  • Garbled accented characters. Set Encoding to the file's real encoding.
  • File not found in server mode. Upload it with the Storage Manager first.

To get data out again, see the pgAdmin export guide in the related pages below, and practise the SQL in the SQL beginner course.

Frequently asked questions

Can pgAdmin create a table from a CSV file automatically?

No. The Import/Export Data dialog copies data into an existing table, so create the table first with columns that match the file.

How do I skip the header row when importing CSV in pgAdmin?

On the Options tab, move the Header switch to Yes. The first line is then read as column names and not imported.

Why is the Import/Export Data option greyed out?

pgAdmin greys out menu items that do not apply to the object selected in the tree control. Select a table in the Object Explorer before opening Tools > Import/Export Data....

How do I import a CSV with a semicolon delimiter?

Set Delimiter on the Options tab to a semicolon. The documented choices are colon, semicolon, vertical bar and tab, besides the comma used for CSV.

Can I import only some columns?

Yes. On the Columns tab, remove the columns you do not want from Columns to export/import; the remaining columns must match the CSV columns in order.

Sources

Checked 8 October 2026.

How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.

Still choosing a SQL client?

Read the full reviews, or compare tools side by side.