Re: Bug: var_is_nonnullable() gives wrong results for old/new in RETURNING

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tender Wang <tndrwang(at)gmail(dot)com>
Cc: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bug: var_is_nonnullable() gives wrong results for old/new in RETURNING
Date: 2026-04-10 06:58:31
Message-ID: CAMbWs4_Kd4Ep6ufUWLG78ZTAbFcZ-rriY8YQ1zd3iqFqtRnGPQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 10, 2026 at 2:48 PM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> The patch also LGTM. I also checked if has_notnull_forced_var() has
> the same issue, but it doesn't: Vars with non-default returning type
> only appear in the RETURNING clause, so they never show up in WHERE/ON
> clauses.

I pushed the patch after a bit cosmetic tweaks. I also decided to put
the test cases in returning.sql, which I think is a better place.

Thanks for the report and the patch.

- Richard

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2026-04-10 07:00:00 Re: Adding REPACK [concurrently]
Previous Message Thomas Munro 2026-04-10 06:33:30 Re: Trying out libarchive for reading user-generated WAL tarballs