title: Node-postgres parameterized queries with array parameter
body: <p>I'm trying to execute this PSQL query to call a function and get a list of ids back. [This function works when run in PGAdmin as it should, verified by the ids coming back.]</p>
  
  <pre><code>SELECT get_dataids(
    'university',
    '2015-08-01',
    '2015-08-02',
    array ['air1'],
   'electricity_egauge_minutes'
  );
  </code></pre>
  
  <p>I am using node-postgres (<a href="https://github.com/brianc/node-postgres" rel="nofollow">https://github.com/brianc/node-postgres</a>) and have been using parameterized queries as such. [This function is successful in the Node backend.]</p>
  
  <pre><code>  var client = new pg.Client(connectionString);
    client.connect();
    return client.query('SELECT ercot.get_live_realtime_lmp($1, $2)',
      ['ercot', 'zone'])
    .then(data =&gt; {
      client.end();
      return data.rows;
    })
    .catch(err =&gt; {
      client.end();
      console.log('err', err);
    });
  </code></pre>
  
  <p>This is the actual query I am trying to run:</p>
  
  <pre><code>  return client.query('SELECT public.get_dataids($1, $2, $3, $4, $5)',
      [
      'university',
      '2015-08-01',
      '2015-08-02',
      ['air1'],
      'electricity_egauge_minutes',
    ])
  </code></pre>
  
  <p>I had thought I would be able to pass an array as a parameter to the function, but it does not seem to be working (as evidenced by 1) not returning the same ids as the raw SQL query, and 2) passing any string into the array returns the same non-list of ids).</p>
  
  <p>I am guessing the issue is specifically trying to pass an array, but I am not able to figure out the accurate way to actually pass in an array. I have tried an empty array, an array with an empty string, passing a string with <code>'array ["air1"]'</code>, passing in just the string <code>'air1'</code>, etc. One of the errors come back as: <code>error: malformed array literal</code>, which leads me to believe it's the way I'm passing in the array. Any suggestions would be appreciated.</p>