Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WUdnr-0007NG-Up for pgsql-bugs@arkaria.postgresql.org; Mon, 31 Mar 2014 15:07:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WUdnr-0007Ks-BJ for pgsql-bugs@arkaria.postgresql.org; Mon, 31 Mar 2014 15:07:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WUdnq-0007Kl-Ba for pgsql-bugs@postgresql.org; Mon, 31 Mar 2014 15:07:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WUdnn-0002PQ-MY for pgsql-bugs@postgresql.org; Mon, 31 Mar 2014 15:07:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s2VF76Iu016087; Mon, 31 Mar 2014 11:07:06 -0400 From: Tom Lane To: larry.price@enterprisedb.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #9776: well formed json with embedd colon ':' causes error on copy In-reply-to: <20140329224145.342.43172@wrigleys.postgresql.org> References: <20140329224145.342.43172@wrigleys.postgresql.org> Comments: In-reply-to larry.price@enterprisedb.com message dated "Sat, 29 Mar 2014 22:41:45 -0000" Date: Mon, 31 Mar 2014 11:07:06 -0400 Message-ID: <16086.1396278426@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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