BUG #12320: json parsing with embedded double quotes

From: postgres(at)bt-r(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #12320: json parsing with embedded double quotes
Date: 2014-12-22 20:52:48
Message-ID: 20141222205248.11503.72633@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

The following bug has been logged on the website:

Bug reference: 12320
Logged by: Aaron Botsis
Email address: postgres(at)bt-r(dot)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":""}

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G Johnston 2014-12-23 06:02:43 Re: BUG #12319: NPE in JDBC driver when using PgCopyOutputStream
Previous Message dhalperi 2014-12-22 20:04:03 BUG #12319: NPE in JDBC driver when using PgCopyOutputStream

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-12-22 21:24:05 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Previous Message Stephen Frost 2014-12-22 20:45:44 Re: Role Attribute Bitmask Catalog Representation