title: node-postgres: how to prepare a statement without executing the query?
body: <p>I want to create a "prepared statement" in postgres using the node-postgres module. I want to create it without binding it to parameters because the binding will take place in a loop.</p>
  
  <p>In the <a href="https://github.com/brianc/node-postgres/wiki/Client#method-query-prepared" rel="noreferrer">documentation</a> i read :</p>
  
  <pre><code>query(object config, optional function callback) : Query
  If _text_ and _name_ are provided within the config, the query will result in the creation of a prepared statement.
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>client.query({"name":"mystatement", "text":"select id from mytable where id=$1"});
  </code></pre>
  
  <p>but when I try passing only the text &amp; name keys in the config object, I get an exception :</p>
  
  <p>(translated) message is binding 0 parameters but the prepared statement expects 1</p>
  
  <p>Is there something I am missing ? How do you create/prepare a statement without binding it to specific value in order to avoid re-preparing the statement in every step of a loop ?</p>