CSV to PostgreSQL INSERT statements
This page produces PostgreSQL-ready INSERT statements from a CSV. Booleans are written as TRUE and FALSE, identifiers that need quoting get double quotes, and numeric columns are emitted without quotes.
PostgreSQL users often reach for COPY, but INSERT statements are easier to paste and review. Either way, the CSV is parsed locally and no row is transmitted.
SQL INSERT
Drop a file to generate INSERT statements
Processing stays in this browser. Guests can process up to 500 rows per file.
How to use this tool
- 1Drop your CSV file.
- 2Keep Dialect on PostgreSQL.
- 3Confirm the table name and batch size.
- 4Copy or download the .sql file.
Frequently asked questions
- INSERT or COPY — which does this produce?
- INSERT statements. They are easy to review and paste, whereas COPY usually needs a server-side file.
- Are NULLs written correctly?
- Empty cells become the SQL keyword NULL, unquoted.
- Can the table name include a schema?
- You can type a name with dots, but for most cases enter the table name and add the schema when you run the statement.
- Does it handle UTF-8 text?
- Yes. UTF-8 with or without a BOM is read correctly, and GBK CSV files are also auto-detected.
Private by design
This tool runs entirely in your browser. Files, tables, and results are never uploaded to a server — you can even disconnect your network and keep working. See the Privacy Policy.