Skip to content

invalid string in message #64

Closed
Closed
@chowey

Description

@chowey

This just popped up starting with node v0.5.10. I am not able to get any query to work. The pg module seems to connect to the database, but it gets an error when it runs a query.

Here is some sample code that will produce this error:

var pg = require('pg'),
    util = require('util');
var connectstring = 'pg://user:password@127.0.0.1/db1';

function getTheTime() {
  pg.connect(connectstring, function (err, client) {
    if (err) util.log('Error with pg.connect!'), util.log(util.inspect(err));
    else client.query('SELECT now() as when', function (err, result) {
      if (err) util.log('Error with client.query!'), util.log(util.inspect(err));
      else util.log('The postres time is: ' + result.rows[0].when);
    });
  });
}

getTheTime();

This gives the following output:

31 Oct 13:24:35 - Error with client.query!
31 Oct 13:24:35 - { [error: invalid string in message]
  length: 100,
  name: 'error',
  severity: 'ERROR',
  code: '08P01',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  file: '.\\src\\backend\\libpq\\pqformat.c',
  line: '636',
  routine: 'pq_getmsgstring' }

I don't know what invalid string in message means or even where to begin looking in the module code. I tried it with postgres v8.4, and with postgres v9.0.

Per the node blog, node v0.5.10 is supposed to be the last version before node v0.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions