We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c840aa commit 00d749cCopy full SHA for 00d749c
lib/client.js
@@ -305,20 +305,7 @@ Client.prototype.getTypeParser = function (oid, format) {
305
306
// Ported from PostgreSQL 9.2.4 source code in src/interfaces/libpq/fe-exec.c
307
Client.prototype.escapeIdentifier = function (str) {
308
- var escaped = '"'
309
-
310
- for (var i = 0; i < str.length; i++) {
311
- var c = str[i]
312
- if (c === '"') {
313
- escaped += c + c
314
- } else {
315
- escaped += c
316
- }
317
318
319
- escaped += '"'
320
321
- return escaped
+ return '"' + str.replace(/"/g, '""') + '"'
322
}
323
324
0 commit comments