-
- Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Column names with >1 apostrophe not escaped correctly in .query():
var pg = require('pg'); // version 4.4.4 var conString = "postgres://..."; // pg.connect(conString, function(err, client, done) { // client.query("CREATE TABLE atable ( \"column''name\" TEXT )"); // }); pg.connect(conString, function(err, client, done) { client.query("SELECT * FROM atable"); });$ node bug.js undefined:4 this['column\''name'] = rowData[0] == null ? null : parsers[0](rowData[0]); ^^^^ SyntaxError: Unexpected token ILLEGAL at Function (native) at Result.addFields (.../node_modules/pg/lib/result.js:98:20) at Query.handleRowDescription (.../node_modules/pg/lib/query.js:54:16) at null.<anonymous> (.../node_modules/pg/lib/client.js:103:24) at emitOne (events.js:77:13) at emit (events.js:169:7) at Socket.<anonymous> (.../node_modules/pg/lib/connection.js:109:12) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at readableAddChunk (_stream_readable.js:146:16) Metadata
Metadata
Assignees
Labels
No labels