title: Importing CLOB to PostgreSQL using PGloader
body: <p>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:</p>
  
  <ul>
  <li><p><strong>data.csv</strong></p>
  
  <pre><code>1|some_clob.dat
  2|some_clob.dat
  </code></pre></li>
  <li><p>configuration file: <strong>pgloader.conf</strong></p>
  
  <pre><code>[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
  </code></pre></li>
  </ul>
  
  <p>For that import I've decided to use PGloader tool (Python script, I'm on Windows BTW). But when I execute:</p>
  
  <blockquote>
    <p>pgloader.py -c pgloader.conf</p>
  </blockquote>
  
  <p>I get the <strong>error</strong> in log file:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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</p>
  
  <p>Regards</p>