I have a need to import a CLOB and BLOB objects exported from other DBMS to PostgreSQL. Such LOBs are a separate files whose path references are placed in a CSV file. The structure of table is (id int PK, clobcol text).
Here is the example structure:
-
data.csv
1|some_clob.dat 2|some_clob.dat -
configuration file: pgloader.conf
[pgsql] host = localhost port = 5432 base = test user = some_user pass = log_file = d:/tmp/pgloader.log log_min_messages = DEBUG client_min_messages = WARNING lc_messages = C client_encoding = 'utf-8' copy_every = 5 commit_every = 5 #copy_delimiter = % null = "" empty_string = "\ " [clob] table = clob_table format = text filename = D:/pgloader-2.3.2/test/data.csv field_sep = | quotechar = " columns = id:1, clobcol:2 index = id:1 blob_columns = clobcol:2:ifx_clob
For that import I’ve decided to use PGloader tool (Python script, I’m on Windows BTW). But when I execute:
pgloader.py -c pgloader.conf
I get the error in log file:
Warning: column 'clobcol' is not a valid blob reference: d:/pgloader-2.3.2/test/clob.out
need more than 1 value to unpack
COPY error on lines 1
and the record lands in database in form of: (id: 1, clobcol: ‘some_clob.dat’).
I have no idea what’s wrong and how to correct that. Can you give me any suggestions?
Thank you
Regards
Resolved: missing range of CLOB data to copy.
E.g: