Re: Possible Bug in JSON_QUERY() Behavior in PostgreSQL 17 - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Possible Bug in JSON_QUERY() Behavior in PostgreSQL 17
Date
Msg-id CAKFQuwYPVx_V92BerbW6_Bqzps_TS2NWs6UrYw4mYeruQ0vE9g@mail.gmail.com
Whole thread Raw
In response to Possible Bug in JSON_QUERY() Behavior in PostgreSQL 17  (Susmitha S <susmithaselvarani.ds@gmail.com>)
List pgsql-bugs
On Thursday, February 20, 2025, Susmitha S <susmithaselvarani.ds@gmail.com> wrote:
    • However, when the ERROR ON ERROR clause is omitted, instead of throwing an error or returning a meaningful response, it simply returns an empty result.

image.png



The meaning of “empty result” in PostgreSQL is a result set with zero rows.  As shown here you get a result/rows, their contents are just null (consider using \pset null ‘<null>’ or some such if you want to distinguish empty string from nulls).

As already mentioned, the production of a null value for non-matches is the documented behavior.

David J.

Attachment

pgsql-bugs by date:

Previous
From: Kashaela Ransaw
Date:
Subject: error -10825
Next
From: Matthias Apitz
Date:
Subject: Re: BUG #18822: mailing lists reject mails due to DKIM-signature