Re: Inconsistent RestrictInfo serial numbers

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-11-06T10:40:25Z
Lists: pgsql-hackers
On Tue, Oct 8, 2024 at 8:20 PM Richard Guo <guofenglinux@gmail.com> wrote:
>
> I ran into an "ERROR:  variable not found in subplan target lists"
> error, which can be reproduced with the following query.

> To fix, I think we can reset the root->last_rinfo_serial counter after
> generating the additional constant-FALSE RestrictInfo.  Please see
> attached.

I intend to push this patch shortly, barring any objections, so that
it can catch up with the next minor release (Nov. 14).

Thanks
Richard



Commits

  1. Fix inconsistent RestrictInfo serial numbers

  2. Recalculate where-needed data accurately after a join removal.

  3. Add better handling of redundant IS [NOT] NULL quals