title: Loading data into Postgres from file
body: <p>I have the following two files, the first is a data file, where the first column is the unique identifier of the row and the second which represents a dictionary of the fields following the id field.</p>
  
  <pre><code>&gt; cat data
  1,NULL,37,M,NULL
  2,NULL,25,F,NULL
  3,NULL,42,F,NULL
  4,NULL,18,M,NULL
  
  &gt; cat .dictionary
  0,balance|double
  1,age|int
  2,gender|string
  3,state|string
  </code></pre>
  
  <p>The size of the data file could be very large.</p>
  
  <p>How can I get this data into Postgres? Should I write my own custom data loader program which parses the files and creates a .sql file which can then be used? Or connect directly to the database via JDBC and load it in that way?</p>