title: Can't use parameterized SQL Statements with Node.js and Postgres
body: <p>I've been banging my head with this since last night. When I add parameters to the sql, it doesn't work.</p>
  
  <pre><code>var findOne = function(username, cb) {
      pg.connect(pgURL, function(err, client, done) {
          var query = client.query('SELECT * FROM users WHERE username = $1', [username]);
          done();
  
          query.on('row', function(row) {
              cb(err, row);
          });
      });
  };
  </code></pre>
  
  <p>However, if I do an SQL statement without parameterization it works just fine.</p>
  
  <pre><code>var query = client.query("SELECT * FROM users WHERE username = 'foobar'");
  </code></pre>
  
  <p>Also, doing a console.log(query), right after done(), yields the following:</p>
  
  <pre><code>13:48:00 web.1  | { domain: null,
  13:48:00 web.1  |   _events: null,
  13:48:00 web.1  |   _maxListeners: 10,
  13:48:00 web.1  |   name: undefined,
  13:48:00 web.1  |   text: 'SELECT * FROM users WHERE username = $1',
  13:48:00 web.1  |   values: [ '{"username":"foobar"}' ],
  13:48:00 web.1  |   callback: undefined,
  13:48:00 web.1  |   _result: 
  13:48:00 web.1  |    { command: null,
  13:48:00 web.1  |      rowCount: null,
  13:48:00 web.1  |      oid: null,
  13:48:00 web.1  |      rows: [],
  13:48:00 web.1  |      fields: [],
  13:48:00 web.1  |      _parsers: [],
  13:48:00 web.1  |      RowCtor: null },
  13:48:00 web.1  |   _addedFields: false,
  13:48:00 web.1  |   _canceledDueToError: false }
  </code></pre>
  
  <p>What am I doing wrong here?</p>