title: How to set columns when using helpers in pg-promise
body: <p>Developed by node.js. I am using <a href="https://github.com/vitaly-t/pg-promise" rel="nofollow noreferrer">pg-promise</a>.</p>
  
  <p>There is a problem with inserting the following data.</p>
  
  <p>I want to insert multiple rows of data into the table below.</p>
  
  <pre><code>create table info (
    id varchar(20) not null,
    name varchar(20) not null,
    createdate timestamp with time zone not null
  )
  </code></pre>
  
  <p>I inserted the data below.</p>
  
  <pre><code>let info = [
    { myid: '0001', myname: 'name1' },
    { myid: '0002', myname: 'name2' },
    { myid: '0003', myname: 'name3' },
  ]
  </code></pre>
  
  <p>I originally inserted the following.</p>
  
  <pre><code>for (let i = 0; i &lt;info.length; i ++) {
    db.none (`INSERT INTO info (id, name, createdate ') VALUES ($1, $2, CURRENT_TIMESTAMP)`, [info[i].id, info[i].name])
  }
  </code></pre>
  
  <p>I want to fix it correctly using pg-promise.</p>
  
  <pre><code>const dataMulti = info
  const cs = new pgp.helpers.ColumnSet(
  [
    'id',
    'name',
    'createdate',
  ], {
    table: 'info',
  })
  await db.none(pgp.helpers.insert(dataMulti, cs))
  </code></pre>
  
  <p>Here,</p>
  
  <p><strong>1. Can not insert when the key of the insert data is different from the . columns name of the table?</strong></p>
  
  <blockquote>
    <p>I know there is pgp.helpers.ColumnSet()</p>
    
    <p>Error: Property 'id' does not exist.</p>
    
    <p>The same error occurs.</p>
    
    <p>I am curious about the relationship between table column names and
    ColumnSets for column settings.</p>
  </blockquote>
  
  <p><strong>2. When using the helpers above, how do I insert the current time current_timestamp in the database?</strong></p>
  
  <p>Thank you for your answers to the two questions.</p>