Re: jsonb_path_query unexpected results when filter key / path does not exist..

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ron Clarke <rclarkeai(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: jsonb_path_query unexpected results when filter key / path does not exist..
Date: 2022-11-16 21:02:40
Message-ID: CAKFQuwaf76B42cbXhnoHB4Xcr3h15_LiXiVscR6kAFyfs=xuuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Nov 16, 2022 at 1:45 PM Ron Clarke <rclarkeai(at)gmail(dot)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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Masahiko Sawada 2022-11-17 01:17:59 Re: WAL segments removed from primary despite the fact that logical replication slot needs it.
Previous Message Ron Clarke 2022-11-16 20:45:26 jsonb_path_query unexpected results when filter key / path does not exist..