Skip to content

invalid string in message #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chowey opened this issue Oct 31, 2011 · 1 comment
Closed

invalid string in message #64

chowey opened this issue Oct 31, 2011 · 1 comment

Comments

@chowey
Copy link
Contributor

chowey commented Oct 31, 2011

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.

@chowey
Copy link
Contributor Author

chowey commented Oct 31, 2011

No worries, I upgraded to the latest version of pg and it works.

@chowey chowey closed this as completed Oct 31, 2011
brianc added a commit that referenced this issue Dec 20, 2019
This includes fixes in pg-cursor@2.0.1.  I've relaxed semver a touch so I don't have to release a new version here just for patch changes to pg-cursor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant