Re: BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN - Mailing list pgsql-bugs

From Richard Guo
Subject Re: BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN
Date
Msg-id CAMbWs4-8iPbMZy3+pTvM1EkTyYNGVhX+GX+d9MUXYpYGkB6qJg@mail.gmail.com
Whole thread Raw
In response to Re: BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN  (Tender Wang <tndrwang@gmail.com>)
Responses Re: BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN
List pgsql-bugs
On Thu, Sep 11, 2025 at 10:40 AM Tender Wang <tndrwang@gmail.com> wrote:
> Richard Guo <guofenglinux@gmail.com> 于2025年9月10日周三 21:29写道:
>> I'm wondering if this is the only case we've overlooked.  How about
>> other Json-related expressions?

> Yeah, I have the same question. I tried my fix on json_object/json_arrayagg/json_objectagg.
> These returned the same results.

json_object is also represented as a JsonConstructorExpr.

json_arrayagg and json_objectagg are aggregates, so the subquery won't
be pulled up in the first place.

I tested JsonExpr, which is the representation of json_value,
json_query and json_exists.  It seems that they could not produce
non-NULL output with a NULL input.  So we are good on that front.

- Richard



pgsql-bugs by date:

Previous
From: Tender Wang
Date:
Subject: Re: BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN
Next
From: Tom Lane
Date:
Subject: Re: BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN