Free PostgreSQL importer — no upload, no account

Convert CSV to PostgreSQL
COPY or INSERT,
your choice.

Free CSV to PostgreSQL converter. Generate COPY FROM STDIN or batch INSERT with ON CONFLICT upsert, SERIAL primary key, schema-qualified tables and accurate PostgreSQL type inference. Runs entirely in your browser.

Your data never leaves your browser
COPY FROM STDIN
ON CONFLICT upsert
Copy to clipboard
Always free
CSV to PostgreSQL Converter  100% client-side
Drop your CSV file here
PostgreSQL types inferred — BOOLEAN, INTEGER, NUMERIC, DATE, TIMESTAMPTZ, TEXT…
 SQL generated

      
PostgreSQL-specific features

What makes this different from the generic CSV to SQL tool.

COPY FROM STDIN
Generates PostgreSQL's native bulk import syntax — the fastest way to load large CSV files directly in psql without server file access.
ON CONFLICT upsert
PostgreSQL's standard upsert syntax — inserts or updates on conflict using EXCLUDED.col references for all non-key columns.
SERIAL / BIGSERIAL
Adds a standard PostgreSQL auto-increment primary key using SERIAL (up to 2B) or BIGSERIAL (up to 9 quintillion).
Schema-qualified tables
Supports schema.table notation — e.g. public.users or sales.orders — for multi-schema databases.
TIMESTAMPTZ
Detects ISO 8601 datetime strings and uses TIMESTAMPTZ — the correct timezone-aware type for PostgreSQL, not the naive TIMESTAMP.
Standard SQL quoting
Uses double-quote identifiers and standard single-quote escaping ('' not \') — correct for PostgreSQL and ANSI SQL compliant.
Native PostgreSQL CSV import commands

Faster alternatives when you have direct database access.

\copy — client-side COPY, no server file access needed
\copy your_table FROM '/local/path/file.csv' WITH (FORMAT csv, HEADER true, DELIMITER ',', QUOTE '"');
Run in psql. Reads the CSV from the client machine — works with remote databases, cloud hosts (RDS, Supabase, Neon) without server file access.
COPY — server-side, fastest for large files
COPY your_table FROM '/server/path/file.csv' WITH (FORMAT csv, HEADER true);
Requires superuser or pg_read_server_files role. The path must be on the PostgreSQL server filesystem. Not available on most managed cloud databases.
psql one-liner — import from command line
psql -U username -d database -c "\copy table FROM 'file.csv' CSV HEADER"
Combines psql and \copy into a single command. Works with remote databases using the -h flag for host and -p for port.
How to import CSV into PostgreSQL

Three steps — choose INSERT for compatibility or COPY for speed.

1
Upload your CSV

Drop your CSV file. CSVShift samples up to 200 rows per column to infer PostgreSQL types — BOOLEAN, INTEGER, BIGINT, NUMERIC, DATE, TIMESTAMPTZ, VARCHAR or TEXT. Pre-fills the table name from the filename.

2
Choose COPY or INSERT

COPY FROM STDIN generates the psql bulk import syntax — paste the output into a psql session for maximum speed. Batch INSERT generates standard SQL runnable in pgAdmin, DBeaver or any PostgreSQL client without needing a psql session.

3
Run in psql or pgAdmin

Copy the SQL to clipboard and paste into pgAdmin's query window, DBeaver or a psql session. Or download the .sql file and run with: psql -U user -d db < file.sql

When do you need CSV to PostgreSQL conversion?

Common PostgreSQL workflows that start with a CSV file.

Cloud PostgreSQL (RDS, Supabase, Neon)

Managed PostgreSQL hosts don't allow server-side COPY. The \copy command or INSERT statements from CSVShift work with any cloud PostgreSQL instance over a standard connection — no server file access required.

MySQL to PostgreSQL migration

The standard migration path is: export MySQL as CSV → convert to PostgreSQL INSERT statements here → import. Avoids dialect incompatibilities in SQL dump conversion and works with any migration tool.

Seeding test databases

Converting fixture CSV files to PostgreSQL INSERT statements produces seed scripts that work in CI/CD pipelines and development environments — shareable, version-controllable, and runnable in any PostgreSQL client.

Incremental loads with ON CONFLICT

Using ON CONFLICT DO UPDATE, the same CSV can be re-imported to upsert records — inserting new rows and updating changed ones without truncating the table or running a separate UPDATE query.

Related CSV tools

Other free converters on CSVShift you might need.

Popular searches
import csv to postgresql csv to postgres converter copy csv to postgres table import csv to postgres how to import csv to postgresql copy data from csv to postgresql csv to postgresql insert csv to postgresql copy command postgresql on conflict csv import psql copy csv header convert csv to postgres table csv to supabase postgresql

PostgreSQL SQL generated
in your browser. No upload.

CSVShift generates COPY and INSERT syntax entirely in JavaScript in your browser. Your CSV never leaves your device. The standard SQL string escaping (doubling single quotes, no backslash escaping) follows ANSI SQL and PostgreSQL standards — producing output that runs without modification in any PostgreSQL version.

TIMESTAMPTZ detection
ISO 8601 datetime strings become TIMESTAMPTZ — the timezone-aware PostgreSQL type, not the naive TIMESTAMP.
COPY FROM STDIN
The fastest PostgreSQL import method — works with remote cloud databases via psql without server file access.
ON CONFLICT with EXCLUDED
Full upsert syntax with EXCLUDED.col references — standard PostgreSQL 9.5+ ON CONFLICT DO UPDATE pattern.
Free, no conditions
No row limit, no file size cap, no watermark. Funded by display advertising only.
Frequently asked questions
Common questions about importing CSV files into PostgreSQL.
How do I import a CSV file into PostgreSQL?
Three options: 1) In psql: \copy table FROM 'file.csv' CSV HEADER; — works with any database including cloud. 2) Generate INSERT statements here and run with psql -U user -d db < file.sql. 3) Use pgAdmin's Import/Export tool via the table context menu.
What is the difference between COPY and INSERT in PostgreSQL?
COPY reads data as a stream and bypasses row-level SQL parsing — typically 5–10x faster than INSERT for large datasets. INSERT is standard SQL, supports ON CONFLICT upsert, works in any client, and is easier to debug row by row. Use COPY for bulk loads, INSERT for incremental imports with conflict handling.
How do I use \copy in psql to import CSV?
Connect with psql and run: \copy your_table FROM '/local/path/file.csv' WITH (FORMAT csv, HEADER true); — the backslash prefix means psql reads the file from your local machine, not the server. This works with all cloud PostgreSQL providers (RDS, Supabase, Neon, Render).
How does ON CONFLICT work for CSV imports in PostgreSQL?
ON CONFLICT (PostgreSQL 9.5+) handles duplicate key violations during INSERT. ON CONFLICT DO NOTHING silently skips duplicates. ON CONFLICT (id) DO UPDATE SET col = EXCLUDED.col updates existing rows with the new values. CSVShift generates the full ON CONFLICT clause with EXCLUDED references for all non-key columns.
Is my data safe when generating PostgreSQL SQL online?
Yes. The entire SQL generation runs in your browser in JavaScript. Your CSV data is never uploaded to any server. Open the Network inspector during conversion — zero outbound data requests are made.