pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
function 'IS JSON ARRAY' not identified
3+ messages / 2 participants
[nested] [flat]

* function 'IS JSON ARRAY' not identified
@ 2025-06-02 14:41 Badia, Antonio <antonio.badia@louisville.edu>
  2025-06-02 15:19 ` Re: function 'IS JSON ARRAY' not identified Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Badia, Antonio @ 2025-06-02 14:41 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Table 'Jsondata2' contains 2 columns, 'id' and 'data'. 'data' is of jsonb type.
When running query
select d.data - 'keya' ||  jsonb_build_object('keya', jsonb_array_elements(d.data::jsonb-> 'keya'))
from "Jsondata2" as d
where jsonb_exists(d.data '$.keya') and d.data->'keya' is not null and d.data->'keya' IS JSON ARRAY;
I get the error message:
ERROR: syntax error at or near "JSON" LINE 3: ... d.data->'keya' is not null and d.data->'keya' IS JSON ARRAY... ^
SQL state: 42601
Character: 213

Running Postgresql on MacOS (Sequoia 15.5), installed via homebrew:
antonio@mac POSTGRES % psql
psql (14.18 (Homebrew), server 14.17 (Homebrew))

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: function 'IS JSON ARRAY' not identified
  2025-06-02 14:41 function 'IS JSON ARRAY' not identified Badia, Antonio <antonio.badia@louisville.edu>
@ 2025-06-02 15:19 ` Tom Lane <tgl@sss.pgh.pa.us>
  2025-06-02 15:26   ` Re: function 'IS JSON ARRAY' not identified Badia, Antonio <antonio.badia@louisville.edu>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2025-06-02 15:19 UTC (permalink / raw)
  To: Badia, Antonio <antonio.badia@louisville.edu>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

"Badia, Antonio" <antonio.badia@louisville.edu> writes:
> When running query
> select d.data - 'keya' ||  jsonb_build_object('keya', jsonb_array_elements(d.data::jsonb-> 'keya'))
> from "Jsondata2" as d
> where jsonb_exists(d.data '$.keya') and d.data->'keya' is not null and d.data->'keya' IS JSON ARRAY;
> I get the error message:
> ERROR: syntax error at or near "JSON" LINE 3: ... d.data->'keya' is not null and d.data->'keya' IS JSON ARRAY... ^
> SQL state: 42601
> Character: 213

> Running Postgresql on MacOS (Sequoia 15.5), installed via homebrew:
> antonio@mac POSTGRES % psql
> psql (14.18 (Homebrew), server 14.17 (Homebrew))

IS JSON ARRAY was added in PG v16.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: function 'IS JSON ARRAY' not identified
  2025-06-02 14:41 function 'IS JSON ARRAY' not identified Badia, Antonio <antonio.badia@louisville.edu>
  2025-06-02 15:19 ` Re: function 'IS JSON ARRAY' not identified Tom Lane <tgl@sss.pgh.pa.us>
@ 2025-06-02 15:26   ` Badia, Antonio <antonio.badia@louisville.edu>
  0 siblings, 0 replies; 3+ messages in thread

From: Badia, Antonio @ 2025-06-02 15:26 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Tom,
 thanks for taking a look at this so quickly. Shame homebrew is so behind, but this is a kind of a relief.
Regards,
Antonio
________________________________
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Monday, June 2, 2025 11:19 AM
To: Badia, Antonio <antonio.badia@louisville.edu>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: function 'IS JSON ARRAY' not identified

CAUTION: This email originated from outside of our organization. Do not click links, open attachments, or respond unless you recognize the sender's email address and know the contents are safe.

"Badia, Antonio" <antonio.badia@louisville.edu> writes:
> When running query
> select d.data - 'keya' ||  jsonb_build_object('keya', jsonb_array_elements(d.data::jsonb-> 'keya'))
> from "Jsondata2" as d
> where jsonb_exists(d.data '$.keya') and d.data->'keya' is not null and d.data->'keya' IS JSON ARRAY;
> I get the error message:
> ERROR: syntax error at or near "JSON" LINE 3: ... d.data->'keya' is not null and d.data->'keya' IS JSON ARRAY... ^
> SQL state: 42601
> Character: 213

> Running Postgresql on MacOS (Sequoia 15.5), installed via homebrew:
> antonio@mac POSTGRES % psql
> psql (14.18 (Homebrew), server 14.17 (Homebrew))

IS JSON ARRAY was added in PG v16.

                        regards, tom lane

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-06-02 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-06-02 14:41 function 'IS JSON ARRAY' not identified Badia, Antonio <antonio.badia@louisville.edu>
2025-06-02 15:19 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-06-02 15:26   ` Badia, Antonio <antonio.badia@louisville.edu>

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