From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Refactor pull_var_clause's API to make it less tedious to extend
Date: Thu, 10 Mar 2016 20:53:27 +0000
Message-ID: <E1ae7aJ-0001MB-6b@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Refactor pull_var_clause's API to make it less tedious to extend.
In commit 1d97c19a0f748e94 and later c1d9579dd8bf3c92, we extended
pull_var_clause's API by adding enum-type arguments. That's sort of a pain
to maintain, though, because it means every time we add a new behavior we
must touch every last one of the call sites, even if there's a reasonable
default behavior that most of them could use. Let's switch over to using a
bitmask of flags, instead; that seems more maintainable and might save a
nanosecond or two as well. This commit changes no behavior in itself,
though I'm going to follow it up with one that does add a new behavior.
In passing, remove flatten_tlist(), which has not been used since 9.1
and would otherwise need the same API changes.
Removing these enums means that optimizer/tlist.h no longer needs to
depend on optimizer/var.h. Changing that caused a number of C files to
need addition of #include "optimizer/var.h" (probably we can thank old
runs of pgrminclude for that); but on balance it seems like a good change
anyway.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/364a9f47ab363250f62dd2c381c4da435283725a
Modified Files
--------------
contrib/postgres_fdw/deparse.c | 1 -
src/backend/catalog/heap.c | 8 +--
src/backend/commands/trigger.c | 4 +-
src/backend/optimizer/path/allpaths.c | 4 +-
src/backend/optimizer/path/equivclass.c | 2 +-
src/backend/optimizer/plan/analyzejoins.c | 1 +
src/backend/optimizer/plan/createplan.c | 2 +-
src/backend/optimizer/plan/initsplan.c | 6 +-
src/backend/optimizer/plan/planner.c | 5 +-
src/backend/optimizer/plan/setrefs.c | 15 +++--
src/backend/optimizer/prep/prepjointree.c | 1 +
src/backend/optimizer/prep/preptlist.c | 3 +-
src/backend/optimizer/util/placeholder.c | 4 +-
src/backend/optimizer/util/tlist.c | 28 --------
src/backend/optimizer/util/var.c | 108 ++++++++++++++++--------------
src/backend/parser/parse_agg.c | 1 +
src/backend/parser/parse_clause.c | 1 +
src/backend/utils/adt/selfuncs.c | 2 +-
src/include/optimizer/tlist.h | 4 +-
src/include/optimizer/var.h | 22 +++---
20 files changed, 94 insertions(+), 128 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: Refactor pull_var_clause's API to make it less tedious to extend
In-Reply-To: <E1ae7aJ-0001MB-6b@gemulon.postgresql.org>
References: <E1ae7aJ-0001MB-6b@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