json_query conditional wrapper bug - Mailing list pgsql-hackers

From Peter Eisentraut
Subject json_query conditional wrapper bug
Date
Msg-id 8022e067-818b-45d3-8fab-6e0d94d03626@eisentraut.org
Whole thread Raw
List 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.



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Support systemd readiness notifications on reload
Next
From: Amit Kapila
Date:
Subject: Re: Conflict detection and logging in logical replication