From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: shahar@cybear.co
Subject: BUG #17660: JSONPATH issue using like_regex followed by the && operator
Date: Sat, 22 Oct 2022 11:55:24 +0000
Message-ID: <17660-3fe48447b080d5b6@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17660
Logged by: Shahar Belizon
Email address: shahar@cybear.co
PostgreSQL version: 14.4
Operating system: CentOS
Description:
Hello,
I've found an issue with the like_regex statement when using it together
with another && condition.
In the following example I'm expecting the result will end as:
[{"id":9,"value":"a"}] but instead, it ends with an empty array:
WITH a(attributes) AS (
SELECT '[{"id":9,"value":"a"},{"id":9,"value":"a$"}]'::jsonb
)
SELECT jsonb_path_query_array(attributes,'$[*] ? (!(@.id==9 && @.value
like_regex "\$$"))') FROM a
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, shahar@cybear.co
Subject: Re: BUG #17660: JSONPATH issue using like_regex followed by the && operator
In-Reply-To: <17660-3fe48447b080d5b6@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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