pgtype icon indicating copy to clipboard operation
pgtype copied to clipboard

incorrect escaping of newlines (\n) in QuoteArrayElementIfNeeded

Open stephane-martin opened this issue 4 years ago • 0 comments

hello,

there: https://github.com/jackc/pgtype/blob/master/array.go#L351

it escapes when the argument starts or ends with a space, but it doesn't escape when the argument starts or ends with a newline

it has manifested in our product in the way that a line was not updated by an INSERT query with a WHERE clause involving TextArray, where as it should have been updated.

maybe there is the same problem with other "space like" characters, such as '\t'.

stephane-martin avatar Jan 06 '21 13:01 stephane-martin