brianc/node-postgres — Issue #99: array parser does not handle commas in text properly
Author: jzimmek
Created: 2012-02-17 13:36:54+00:00
State: open

It seems that something is wrong in the parser for text arrays. A text element containing a "," character will be interpreted as new element. i have not digged deeply in the node-postgres source, but found "test/integration/client/array-test.js"

this will break as soon as i add a "," in the array element:

change from:
client.query('INSERT INTO why(names, numbors) VALUES(\'{"aaron", "brian","a b c" }\', \'{1, 2, 3}\')').on('error', console.log);

change to:
client.query('INSERT INTO why(names, numbors) VALUES(\'{"aaron, INCLUDING COMMA", "brian","a b c" }\', \'{1, 2, 3}\')').on('error', console.log);

is this a known issue and maybe there is already a patch / fix ?

regards
jan