tpaw Docs

CSV Import

Import CSV, TSV, or TXT files into a PostgreSQL table using tpaw's column mapping and preview interface.

CSV Import lets you load rows from a .csv, .tsv, or .txt file directly into a PostgreSQL table. tpaw parses the file, shows a preview of the first 10 rows, auto-maps columns by name, and generates an INSERT INTO ... VALUES ... statement for each row.

Opening the import dialog

With a table open in the Data Grid, click the Import button in the toolbar. Alternatively, right-click the table in the sidebar → Import CSV.

The CSV Import modal opens.

Selecting a file

Click Browse to select a file. tpaw accepts:

  • .csv — comma-separated values
  • .tsv — tab-separated values
  • .txt — plain text with delimiter

The file must have a header row as its first line.

Preview and column mapping

After selecting a file, tpaw:

  1. Parses the first 10 rows as a preview
  2. Shows the CSV headers alongside their sample data
  3. Auto-maps CSV columns to table columns by exact name match (case-insensitive)

For each CSV column, a dropdown lets you select the target table column. You can:

  • Map a CSV column to any table column
  • Leave a CSV column unmapped (those values are skipped)
  • Map multiple CSV columns to the same table column (last value wins)

Running the import

Click Import to start. During import, tpaw shows an 'Importing...' indicator. The import runs as a single operation. After completion, the dialog shows:

  • Total rows imported
  • Any rows that failed (with error reason)

The grid automatically refreshes to show the newly imported data.

Handling errors

Common import errors:

ErrorCauseFix
invalid input syntax for type integerText value in numeric columnCheck the CSV column contains numbers only
null value in column violates not-null constraintEmpty cell in required columnFill in missing values in the CSV or map to a nullable column
value too long for type character varying(N)CSV value exceeds column lengthTruncate values or change the column's max length
duplicate key value violates unique constraintCSV contains duplicate primary keysDeduplicate the CSV or use ON CONFLICT DO NOTHING (not available in the GUI — run SQL manually)

Large files

For very large imports (millions of rows), use COPY FROM via the Query Editor instead:

COPY table_name (col1, col2, col3)
FROM '/path/to/file.csv'
WITH (FORMAT csv, HEADER true, DELIMITER ',');

On this page