Re: jsonb_path_query unexpected results when filter key / path does not exist.. - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: jsonb_path_query unexpected results when filter key / path does not exist..
Date
Msg-id CAKFQuwaf76B42cbXhnoHB4Xcr3h15_LiXiVscR6kAFyfs=xuuA@mail.gmail.com
Whole thread Raw
In response to jsonb_path_query unexpected results when filter key / path does not exist..  (Ron Clarke <rclarkeai@gmail.com>)
List pgsql-bugs
On Wed, Nov 16, 2022 at 1:45 PM Ron Clarke <rclarkeai@gmail.com> wrote:
 
but I would have only expected this to affect the column being created by jsonb_path_query and not to remove the whole result set. 

Except that is exactly what happens when a set-returning function is placed into the target-list and it produces zero rows.

You should not place set-returning functions into the target-list.  They, like any other table, belong in the FROM clause.  The LATERAL modifier was created for just this purpose.

David J.

pgsql-bugs by date:

Previous
From: Ron Clarke
Date:
Subject: jsonb_path_query unexpected results when filter key / path does not exist..
Next
From: Masahiko Sawada
Date:
Subject: Re: WAL segments removed from primary despite the fact that logical replication slot needs it.