Re: BUG #9776: well formed json with embedd colon ':' causes error on copy

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: larry(dot)price(at)enterprisedb(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #9776: well formed json with embedd colon ':' causes error on copy
Date: 2014-03-31 15:07:06
Message-ID: 16086.1396278426@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

larry(dot)price(at)enterprisedb(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-03-31 15:15:23 Re: BUG #9793: to_number wrong convertion
Previous Message Pavel Stehule 2014-03-31 13:38:19 Re: ::date cast error