BUG #12320: json parsing with embedded double quotes - Mailing list pgsql-bugs

From postgres@bt-r.com
Subject BUG #12320: json parsing with embedded double quotes
Date
Msg-id 20141222205248.11503.72633@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #12320: json parsing with embedded double quotes
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      12320
Logged by:          Aaron Botsis
Email address:      postgres@bt-r.com
PostgreSQL version: 9.4.0
Operating system:   Mac OSX
Description:

postgres=# create table ct (data jsonb);
CREATE TABLE
postgres=# copy ct (data) from  '/Users/aaron/Desktop/queries.json';
ERROR:  invalid input syntax for type json
DETAIL:  Token "root" is invalid.
CONTEXT:  JSON data, line 1: ...1418066241619 AND <=1418671041621) AND
user:"root...
COPY ct, line 3, column data:
"{"timestamp":"2014-12-15T19:17:32.505Z","duration":7.947,"query":{"query":{"filtered":{"filter":{"qu..."


This is a sample of the JSON:


{"timestamp":"2014-12-15T19:17:32.505Z","duration":7.947,"query":{"query":{"filtered":{"filter":{"query":{"query_string":{"query":"organization_id:[REDACTED]
AND timestamp:(>=1418066241619 AND <=1418671041621) AND

user:\"root\""}}}}},"from":0,"size":20,"timeout":10000,"sort":{"timestamp":{"order":"desc"}},"facets":{}},"organization_id":"[REDACTED]","indices":["logs.[REDACTED].20141209","logs.[REDACTED].20141208","logs.[REDACTED].20141215","logs.[REDACTED].20141210","logs.[REDACTED].20141213","logs.[REDACTED].20141214","logs.[REDACTED].20141211","logs.[REDACTED].20141212"],"type":"all","level":"info","message":""}

pgsql-bugs by date:

Previous
From: dhalperi@cs.washington.edu
Date:
Subject: BUG #12319: NPE in JDBC driver when using PgCopyOutputStream
Next
From: David G Johnston
Date:
Subject: Re: BUG #12319: NPE in JDBC driver when using PgCopyOutputStream