From: Tom Lane <tgl@sss.pgh.pa.us>
To: larry.price@enterprisedb.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #9776: well formed json with embedd colon ':' causes error on copy
Date: Mon, 31 Mar 2014 11:07:06 -0400
Message-ID: <16086.1396278426@sss.pgh.pa.us> (raw)
In-Reply-To: <20140329224145.342.43172@wrigleys.postgresql.org>
References: <20140329224145.342.43172@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, larry.price@enterprisedb.com
Subject: Re: BUG #9776: well formed json with embedd colon ':' causes error on copy
In-Reply-To: <16086.1396278426@sss.pgh.pa.us>
References: <20140329224145.342.43172@wrigleys.postgresql.org> <16086.1396278426@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox