From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Improve representation of PlanRowMark.
Date: Sun, 15 Mar 2015 22:41:53 +0000
Message-ID: <E1YXHEH-0003rS-8z@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Improve representation of PlanRowMark.
This patch fixes two inadequacies of the PlanRowMark representation.
First, that the original LockingClauseStrength isn't stored (and cannot be
inferred for foreign tables, which always get ROW_MARK_COPY). Since some
PlanRowMarks are created out of whole cloth and don't actually have an
ancestral RowMarkClause, this requires adding a dummy LCS_NONE value to
enum LockingClauseStrength, which is fairly annoying but the alternatives
seem worse. This fix allows getting rid of the use of get_parse_rowmark()
in FDWs (as per the discussion around commits 462bd95705a0c23b and
8ec8760fc87ecde0), and it simplifies some things elsewhere.
Second, that the representation assumed that all child tables in an
inheritance hierarchy would use the same RowMarkType. That's true today
but will soon not be true. We add an "allMarkTypes" field that identifies
the union of mark types used in all a parent table's children, and use
that where appropriate (currently, only in preprocess_targetlist()).
In passing fix a couple of minor infelicities left over from the SKIP
LOCKED patch, notably that _outPlanRowMark still thought waitPolicy
is a bool.
Catversion bump is required because the numeric values of enum
LockingClauseStrength can appear in on-disk rules.
Extracted from a much larger patch to support foreign table inheritance;
it seemed worth breaking this out, since it's a separable concern.
Shigeru Hanada and Etsuro Fujita, somewhat modified by me
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/7b8b8a43317e9e59eca8b511b714a0ab7da5f1cb
Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c | 8 +++--
src/backend/nodes/copyfuncs.c | 4 ++-
src/backend/nodes/outfuncs.c | 4 ++-
src/backend/optimizer/plan/planner.c | 53 +++++++++++++++++------------
src/backend/optimizer/prep/prepsecurity.c | 33 ++++--------------
src/backend/optimizer/prep/preptlist.c | 8 ++---
src/backend/optimizer/prep/prepunion.c | 5 +++
src/backend/parser/analyze.c | 36 +++++++++++++-------
src/backend/tcop/utility.c | 22 +++++-------
src/backend/utils/adt/ruleutils.c | 5 +++
src/include/catalog/catversion.h | 2 +-
src/include/nodes/lockoptions.h | 1 +
src/include/nodes/plannodes.h | 10 ++++--
src/include/parser/analyze.h | 2 +-
14 files changed, 108 insertions(+), 85 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Improve representation of PlanRowMark.
In-Reply-To: <E1YXHEH-0003rS-8z@gemulon.postgresql.org>
References: <E1YXHEH-0003rS-8z@gemulon.postgresql.org>
* 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