From: Noah Misch <noah@leadboat.com>
To: kgrittn@gmail.com
To: thomas.munro@enterprisedb.com
Cc: pgsql-hackers@postgresql.org
Subject: RTE_NAMEDTUPLESTORE, enrtuples and comments
Date: Sat, 10 Jun 2017 23:25:25 -0700
Message-ID: <20170611062525.GA1628882@rfd.leadboat.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
While completing my annual src/backend/nodes/*funcs.c audit, I noticed defects
in commit 18ce3a4 changes to RangeTblEntry:
1. Field relid is under a comment saying it is valid for RTE_RELATION only.
Fields coltypes, coltypmods and colcollations are under a comment saying
they are valid for RTE_VALUES and RTE_CTE only. But _outRangeTblEntry()
treats all of the above as valid for RTE_NAMEDTUPLESTORE. Which is right?
2. New fields enrname and enrtuples are set only for RTE_NAMEDTUPLESTORE, yet
they're under the comment for RTE_VALUES and RTE_CTE. This pair needs its
own comment.
3. Each of _{copy,equal,out,read}RangeTblEntry() silently ignores enrtuples.
_equalRangeTblEntry() ignores enrname, too. In each case, the function
should either use the field or have a comment to note that skipping the
field is intentional. Which should it be?
This fourth point is not necessarily a defect: I wonder if RangeTblEntry is
the right place for enrtuples. It's a concept regularly seen in planner data
structures but not otherwise seen at parse tree level.
nm
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: noah@leadboat.com, kgrittn@gmail.com, thomas.munro@enterprisedb.com
Subject: Re: RTE_NAMEDTUPLESTORE, enrtuples and comments
In-Reply-To: <20170611062525.GA1628882@rfd.leadboat.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox