-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Column names with >1 apostrophe not escaped correctly in .query() #934
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
Comments
node-postgres does not do any escaping of query text. The string is passed to the socket utf8 encoded with no modification. This is by design. If a higher level library using node-postgres is supposed to escape things for you then you might open an issue there; otherwise, you need to manually escape the string |
But the query is valid - It's a simple The problem is that node-postgres tries to extract column names from the data returned from the database, and fails, because of the incorrect handling of column names in the (what seems to be) code generation in |
ohhhh sorry! i see what youre saying now! sorry i am on vacation so didnt read closely. care to submit a PR with a fix for that issue? |
…issue brianc#934). Includes integration test.
Done. Apparently, this problem came up in #507 , but in the accepted fix, only the first apostrophe was being replaced ( I further did a quick search, and found a few other calls to replace, where I think you'd want a Enjoy your holiday :-) |
Author merged #935 Closing issue |
Column names with >1 apostrophe not escaped correctly in
.query()
:The text was updated successfully, but these errors were encountered: