json_query conditional wrapper bug

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: json_query conditional wrapper bug
Date: 2024-08-28 09:21:41
Message-ID: 8022e067-818b-45d3-8fab-6e0d94d03626@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

These are ok:

select json_query('{"a": 1, "b": 42}'::jsonb, 'lax $.b' without wrapper);
json_query
------------
42

select json_query('{"a": 1, "b": 42}'::jsonb, 'lax $.b' with
unconditional wrapper);
json_query
------------
[42]

But this appears to be wrong:

select json_query('{"a": 1, "b": 42}'::jsonb, 'lax $.b' with conditional
wrapper);
json_query
------------
[42]

This should return an unwrapped 42.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiro.Ikeda 2024-08-28 09:32:30 RE: Doc: fix the note related to the GUC "synchronized_standby_slots"
Previous Message Peter Eisentraut 2024-08-28 09:01:22 Re: [PATCH] Support systemd readiness notifications on reload