Batch import TXT into PostgreSQL TEXT

Want to batch import TXT (Text) documents into PostgreSQL TEXT (CLOB) column?

Try Withdata DBBlobEditor, a PostgreSQL TEXT (CLOB) editor, Bulk import TXT into PostgreSQL, East and Fast.

Download DBBlobEditor Download DBBlobEditor

Batch import TXT documents to PostgreSQL TEXT (CLOB) column

Run DBBlobEditor, login to PostgreSQL.

Batch import txt files into PostgreSQL TEXT (CLOB) - login to PostgreSQL

Click “Start New Task – Import LOB From Files” at task dialog.

Batch import txt files into PostgreSQL TEXT (CLOB)  - Task Window

then show the wizard.

1. Configure import TXT settings.

Batch insert txt files into PostgreSQL TEXT (CLOB) - config

2. Bulk import TXT files to PostgreSQL TEXT (CLOB).

Batch save txt files into PostgreSQL TEXT (CLOB)  - import

then you can see importing results

Batch import txt files into PostgreSQL TEXT (CLOB)  - view


More about PostgreSQL TEXT (CLOB) importer

TXT → PostgreSQL reference

Type mapping

Value kindin TXTin PostgreSQL
Int1234, or right-aligned in a fixed-width columninteger
Bigint9007199254740993bigint
Decimal1234.56numeric(p,s)
Float1.234e+10double precision
Textwritten as-is; padding depends on the chosen layoutvarchar(n)
Long textwritten as-istext
Datewhatever the writer chosedate
Datetimewhatever the writer chosetimestamp
Binarynot representablebytea
BooleanY / N, or 1 / 0, or TRUE / FALSEboolean
JSONwritten as-isjsonb

Dialect differences

TXT is a file format and PostgreSQL is a database server, so the target has to be told the types the file never carried – the rows below are where the two sides diverge.

Propertyin TXTin PostgreSQL
port—5432
identifiersNone by convention"double quotes"
row limit—LIMIT n
datesWhatever the writer produced; no convention is guaranteedtimestamp, timestamptz, date, time
long text—TEXT
binaryNot supportedBYTEA
separatorWhatever was chosen - often fixed column widths—
encodingNo declaration - UTF-8 works only with a BOM—
typingNone - every field is text—
shapeFree form; a parser has to be told the layoutTables of rows and columns
ceilingNo formal limit—

Command line

SideCommand
PostgreSQLpg_dump or COPY ... TO
PostgreSQL (load)COPY ... FROM

Convert your data online, free

Free in-browser converters for CSV, Excel, JSON, XML and SQL: Withdata Online Data Conversion. Large files, batch conversion or scheduling? See the offline desktop apps, or browse all data conversion tools.