Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uM6wa-002o7L-PA for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Jun 2025 15:19:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uM6wZ-00Ap0I-Fv for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Jun 2025 15:19:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uM6wZ-00Ap0A-88 for pgsql-bugs@lists.postgresql.org; Mon, 02 Jun 2025 15:19:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uM6wV-0003YQ-2c for pgsql-bugs@lists.postgresql.org; Mon, 02 Jun 2025 15:19:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 552FJFvU3263997; Mon, 2 Jun 2025 11:19:15 -0400 From: Tom Lane To: "Badia, Antonio" cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: function 'IS JSON ARRAY' not identified In-reply-to: References: Comments: In-reply-to "Badia, Antonio" message dated "Mon, 02 Jun 2025 14:41:34 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3263994.1748877555.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 02 Jun 2025 11:19:15 -0400 Message-ID: <3263995.1748877555@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Badia, Antonio" writes: > When running query > select d.data - 'keya' || jsonb_build_object('keya', jsonb_array_elemen= ts(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