How to convert a TSV file to PostgreSQL
A TSV file is just like a CSV, except columns are separated by a Tab character instead of a comma. SQLified detects that automatically — drop the file and it reads each tab-separated column, infers a PostgreSQL type, and writes a clean CREATE TABLE + INSERT script. No need to re-save your data as CSV first, and no database access required to build the SQL.
- Drop your TSV onto the converter above (.tsv, .tab, or tab-delimited .txt all work).
- Review the schema. Adjust any inferred type, mark columns nullable, rename them, or set a primary key.
- Generate the SQL — a
CREATE TABLEplus batchedINSERTstatements. - Run it in Postgres — paste into
psql, pgAdmin, DBeaver, or your Supabase / Neon / RDS console.
Where TSV files come from
Tab-delimited data shows up everywhere once you look: Excel's “Save as → Text (Tab delimited)”, Google Sheets exports, mysqldump --tab, PostgreSQL's own \copy ... TO, and a huge amount of scientific and bioinformatics data (.tsv / .tab). Because tabs almost never appear inside real values, TSV sidesteps the comma-escaping and quoting problems that make messy CSVs painful — which is exactly why so many exports use it.
What the generated SQL looks like
A tab-separated file with columns sample_id, label, collected_on, reading becomes:
CREATE TABLE IF NOT EXISTS "samples" (
"sample_id" INTEGER NOT NULL,
"label" TEXT NOT NULL,
"collected_on" DATE NOT NULL,
"reading" NUMERIC(18,3) NOT NULL
);
INSERT INTO "samples" ("sample_id", "label", "collected_on", "reading") VALUES
('1', 'control', '2026-01-04', '0.482'),
('2', 'treated', '2026-01-04', '1.139');Identifiers are double-quoted (the PostgreSQL standard) and CREATE TABLE IF NOT EXISTS lets you re-run the script safely.
PostgreSQL type inference
SQLified reads the actual values in each tab-separated column and maps them to the right Postgres type:
- Whole numbers →
INTEGER, orBIGINTbeyond the 32-bit range. - Decimals →
NUMERIC(18, n)sized to your data's precision. - Dates and timestamps →
DATEorTIMESTAMP. true/false→BOOLEAN.- Everything else →
TEXT.
Override any guess before generating — handy for sample IDs or codes you'd rather keep as text.
COPY with a tab delimiter vs. INSERT
PostgreSQL can load a TSV directly with COPY samples FROM 'file.tsv' WITH (FORMAT csv, DELIMITER E'\t') — but that needs the file to be reachable from the database host, which managed services like Supabase, Neon, and RDS make difficult.
SQLified instead produces portable INSERT statements you can paste into any SQL console. For large exports it splits them into 1,000-row batches so they import reliably rather than failing as one oversized statement — the simplest path when you only have a SQL editor, not file access.
Frequently asked questions
What counts as a TSV file?
A TSV (tab-separated values) file uses a Tab character between columns instead of a comma. SQLified detects the delimiter automatically, so .tsv, .tab, and tab-delimited .txt files all work.
Why use TSV instead of CSV?
Tabs rarely appear inside real data, so TSV avoids the quoting and escaping headaches CSV runs into when a field contains commas. That makes tab-delimited exports cleaner to parse — and exactly what tools like Excel, mysqldump --tab, and many scientific pipelines produce.
Does it handle large TSV files?
Yes — SQLified handles millions of rows, and the INSERT output is split into 1,000-row batches so even huge tab-delimited exports import without hitting statement-size limits.
How is this different from PostgreSQL's COPY with a tab delimiter?
COPY (or \copy) can load a TSV with DELIMITER E'\t', but it needs file access to the database host. SQLified instead generates portable INSERT statements you can paste into any SQL console — ideal for Supabase, Neon, or RDS where loading a local file is awkward.
Can I set column types and a primary key?
Yes. SQLified infers Postgres types from your data, and you can override any column's type, rename it, mark it nullable, or set a primary key before generating the script.