From: | PG Bug reporting form <noreply(at)postgresql(dot)org> |
---|---|
To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
Cc: | david(at)daily-harvest(dot)com |
Subject: | BUG #15242: JSON functions not recognizing JSON |
Date: | 2018-06-14 17:50:44 |
Message-ID: | 152899864499.24805.18088125700685635313@wrigleys.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 15242
Logged by: David
Email address: david(at)daily-harvest(dot)com
PostgreSQL version: 9.6.6
Operating system: Mac / DBeaver
Description:
I get this error: SQL Error [22023]: ERROR: cannot deconstruct an array as
an object
when running the statement below because the JSON_EACH function doesn't
recognize the JSON. If I remove the json_each function the query runs fine
and executes JSON_ARRAY_LENGTH on the same variable, even though both
functions take json.
WITH sample_text AS
(
SELECT TEXT '[{"id":11,"name":"Chocolate +
Blueberry","sku":"11-CHOBLU"},{"id":11,"name":"Chocolate +
Blueberry","sku":"11-CHOBLU"}]' AS txt
)
SELECT json_array_length(txt::json), json_each(txt::json) FROM sample_text
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2018-06-14 18:12:37 | Re: BUG #15242: JSON functions not recognizing JSON |
Previous Message | Euler Taveira | 2018-06-14 14:28:17 | Re: BUG #15230: "Logical decoding" is not sensitive to client encoding setting |