Skip to content

returning null instead of 'null' for null values #17

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
wavded opened this issue Feb 15, 2011 · 2 comments
Closed

returning null instead of 'null' for null values #17

wavded opened this issue Feb 15, 2011 · 2 comments

Comments

@wavded
Copy link

wavded commented Feb 15, 2011

whew... that's a lot of nulls :) right now I'm getting back 'null' as a string value instead of as a null value when its the case. could we change that to be the null value?

@brianc
Copy link
Owner

brianc commented Feb 15, 2011

Could you provide an example query to reproduce the issue? This works for me

var pg = require('pg');
var conString = "pg://postgres:X@localhost/postgres";
pg.connect(conString, Æ(err, client) {
  client.query("SELECT NULL as val", Æ(err, result) {
    console.log(result.rows[0].val); //outputs 'null'
    console.log(result.rows[0].val === null); //outputs 'true'
  })
})

@wavded
Copy link
Author

wavded commented Feb 15, 2011

my bad, looks like pg is returning correctly. i was translating it into ExtJS and it looks like that is where turned into a string. nevermind. thanks for checking.

brianc added a commit that referenced this issue Dec 18, 2019
brianc added a commit that referenced this issue Dec 20, 2019
Add more versions of node to the travis matrix
brianc added a commit that referenced this issue Dec 27, 2019
* Replace const with var

* Update code to run on 0.10.x +

* Lint
brianc pushed a commit that referenced this issue Apr 28, 2020
Add supporting username and password for socket connections
This issue was closed.
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

2 participants