You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected results when querying a table called 'user' #28
Queries to all other tables work as expected. When I query a table called 'user', it seems to return records from some other table, perhaps postgres' table internally representing database users.
client.query("SELECT * FROM user",function(err,data){console.log(client,err,data);});
However, if I duplicate my users table and name it differently, say 'user_copy', everything works as expected. The easy workaround is to just change the name of my user table.
As a follow up, what I was doing wrong: user is a reserved word in Postgres so a query like SELECT * FROM user returns the current database user. This is fixed by properly quoting the table name:
Activity
pifantastic commentedon Apr 25, 2011
Gah, this appears to be a postgres thing and not related to your module. I apologize!
pifantastic commentedon Apr 25, 2011
As a follow up, what I was doing wrong:
useris a reserved word in Postgres so a query likeSELECT * FROM userreturns the current database user. This is fixed by properly quoting the table name:works as expected. TIL.
Merge pull request #28 from brianc/rickbergfalk-master
When connection fail, emit the error. (#28)
Don’t create promises when callbacks are provided (#31)
Merge pull request #28 from hjr3/ssl-parsing
Fix/changing db name (brianc#28)