title: Node-postgres: named parameters query (nodejs)
body: <p>I used to name my parameters in my SQL query when preparing it for practical reasons like in php with PDO.</p>
  
  <p>So can I use named parameters with node-postgres module?</p>
  
  <p>For now, I saw many examples and docs on internet showing queries like so:</p>
  
  <pre><code>client.query("SELECT * FROM foo WHERE id = $1 AND color = $2", [22, 'blue']);
  </code></pre>
  
  <p>But is this also correct?</p>
  
  <pre><code>client.query("SELECT * FROM foo WHERE id = :id AND color = :color", {id: 22, color: 'blue'});
  </code></pre>
  
  <p>or this</p>
  
  <pre><code>client.query("SELECT * FROM foo WHERE id = ? AND color = ?", [22, 'blue']);
  </code></pre>
  
  <p>I'm asking this because of the numbered parameter <code>$n</code> that doesn't help me in the case of queries built dynamically.</p>