Re: Reduce "Var IS [NOT] NULL" quals during constant folding - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Reduce "Var IS [NOT] NULL" quals during constant folding
Date
Msg-id CAMbWs484o7ZFN_sau09X60GPN8RE12VakD-mtQF482VZk2=4RQ@mail.gmail.com
Whole thread Raw
In response to Re: Reduce "Var IS [NOT] NULL" quals during constant folding  (Tender Wang <tndrwang@gmail.com>)
Responses Re: Reduce "Var IS [NOT] NULL" quals during constant folding
List pgsql-hackers
On Wed, Mar 26, 2025 at 3:06 PM Tender Wang <tndrwang@gmail.com> wrote:
> The comment about  notnullattnums in struct RangeTblEntry says that:
> * notnullattnums is zero-based set containing attnums of NOT NULL
> * columns.
>
> But in get_relation_notnullatts():
> rte->notnullattnums = bms_add_member(rte->notnullattnums,
>                                                                     i + 1);
>
> The notnullattnums seem to be 1-based.

This corresponds to the attribute numbers in Var nodes; you can
consider zero as representing a whole-row Var.

Thanks
Richard



pgsql-hackers by date:

Previous
From: Andy Fan
Date:
Subject: Re: a pool for parallel worker
Next
From: Richard Guo
Date:
Subject: Re: Fix infinite loop from setting scram_iterations to INT_MAX