Re: BUG #9776: well formed json with embedd colon ':' causes error on copy - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #9776: well formed json with embedd colon ':' causes error on copy
Date
Msg-id 16086.1396278426@sss.pgh.pa.us
Whole thread Raw
In response to BUG #9776: well formed json with embedd colon ':' causes error on copy  (larry.price@enterprisedb.com)
List pgsql-bugs
larry.price@enterprisedb.com writes:
> [ backslashes disappearing from an input value ]

> it seems to be stripping the escape sequences before the json is parsed.
> Could be user error. But it appears that strings are not getting escaped
> properly before being parsed as json, but only when the copy statement is
> used. Other json from the same set gets properly inserted.

"User error" sounds about right to me.  What is producing the file you are
feeding to \copy, and is it familiar with the quoting rules for COPY
input?  In particular, the need for backslashes to be doubled?
See File Formats / Text Format, about halfway down this page:
http://www.postgresql.org/docs/9.3/static/sql-copy.html

            regards, tom lane

pgsql-bugs by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: ::date cast error
Next
From: Tom Lane
Date:
Subject: Re: BUG #9793: to_number wrong convertion