On Wed, Mar 26, 2025 at 3:06 PM Tender Wang <tndrw...@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