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