XlsConverter

Excel to PostgreSQL dump with numeric, date and boolean

Upload the Excel workbook, choose PostgreSQL, set schema, table name and column types, then convert and download the .sql file. Run it with psql or any PostgreSQL client.

XLSX

Encrypted, auto-deleted

Demo converts up to 100 rows, once.
Database administrator with a laptop in a server room aisle

PostgreSQL is strict about types, which is good for data quality and bad for quick imports. A spreadsheet column with one stray text cell, a date in the wrong order or an empty string in a numeric column makes the whole COPY or INSERT fail.

XlsConverter checks every value before writing PostgreSQL SQL, so the dump loads on the first run. For MySQL syntax see Excel to MySQL, for a lightweight file database see Excel to SQLite.

How to convert Excel to PostgreSQL in three steps

  1. 1Upload the Excel file.
  2. 2Pick PostgreSQL, the schema, table name and column types.
  3. 3Convert, download and run the .sql file with psql.

Quoted identifiers and strict types in PostgreSQL imports

PostgreSQL folds unquoted identifiers to lowercase. A table created with "Customer Name" in quotes must be queried with the quotes forever, which annoys everyone who writes SQL against it. By default we convert headers to snake_case, so Customer Name becomes customer_name and needs no quoting. You can keep the original names if a tool depends on them.

Types are strict. An empty string is not a valid numeric or date value, so empty cells are written as NULL. Excel TRUE and FALSE become boolean true and false, and columns of Yes and No can be mapped to boolean as well. Numeric precision is taken from the data, so money columns get numeric(12,2) rather than a lossy floating point type.

Wrapping the dump in a single transaction means one bad row rolls back the entire load instead of leaving half a table. For tables with millions of rows, a CSV file loaded with COPY is faster than INSERT statements, so XLSX to CSV is a good companion here, and XLSX to SQL covers the other dialects from the same workbook.

Excel to PostgreSQL questions

How do I import Excel data into PostgreSQL?

Convert the workbook to a PostgreSQL SQL file, then run it with psql -f or paste it into pgAdmin. Types and quoting are already correct.

Why does PostgreSQL reject empty values from Excel?

An empty string is not valid for numeric or date columns. The converter writes NULL for empty cells, which PostgreSQL accepts.

Can I load the data into a schema other than public?

Yes. Set the schema name and the table is created and filled there.

How are Excel booleans converted for PostgreSQL?

TRUE and FALSE cells become boolean values, and Yes or No columns can be mapped to boolean too.

Is there a demo for Excel to PostgreSQL?

Yes, a one-time demo of up to 100 rows, with the SQL downloadable after signup. Full tables require a plan from 24 USD per month billed yearly.

Related converters

Convert full files and batches

Pro starts at $24 per month billed yearly. Cancel any time.

See plans