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:
- Parses the first 10 rows as a preview
- Shows the CSV headers alongside their sample data
- 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:
| Error | Cause | Fix |
|---|---|---|
invalid input syntax for type integer | Text value in numeric column | Check the CSV column contains numbers only |
null value in column violates not-null constraint | Empty cell in required column | Fill in missing values in the CSV or map to a nullable column |
value too long for type character varying(N) | CSV value exceeds column length | Truncate values or change the column's max length |
duplicate key value violates unique constraint | CSV contains duplicate primary keys | Deduplicate 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: