pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Improve parsetree representation of special functions such as CU
Date: Wed, 17 Aug 2016 00:33:09 +0000
Message-ID: <E1bZon7-0003Nn-CQ@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Improve parsetree representation of special functions such as CURRENT_DATE.

We implement a dozen or so parameterless functions that the SQL standard
defines special syntax for.  Up to now, that was done by converting them
into more or less ad-hoc constructs such as "'now'::text::date".  That's
messy for multiple reasons: it exposes what should be implementation
details to users, and performance is worse than it needs to be in several
cases.  To improve matters, invent a new expression node type
SQLValueFunction that can represent any of these parameterless functions.

Bump catversion because this changes stored parsetrees for rules.

Discussion: <30058.1463091294@sss.pgh.pa.us>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0bb51aa96783e8a6c473c2b5e3725e23e95db834

Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c |   9 ++
src/backend/executor/execQual.c                 |  78 +++++++++++++++
src/backend/nodes/copyfuncs.c                   |  19 ++++
src/backend/nodes/equalfuncs.c                  |  14 +++
src/backend/nodes/nodeFuncs.c                   |  27 +++++-
src/backend/nodes/outfuncs.c                    |  14 +++
src/backend/nodes/readfuncs.c                   |  18 ++++
src/backend/optimizer/util/clauses.c            |  16 ++-
src/backend/parser/gram.y                       | 124 ++++++------------------
src/backend/parser/parse_expr.c                 |  62 ++++++++++++
src/backend/parser/parse_target.c               |  43 ++++++++
src/backend/utils/adt/date.c                    |  93 ++++++++++++++++--
src/backend/utils/adt/ruleutils.c               |  62 ++++++++++++
src/backend/utils/adt/timestamp.c               |  60 ++++++++++--
src/include/catalog/catversion.h                |   2 +-
src/include/nodes/nodes.h                       |   1 +
src/include/nodes/primnodes.h                   |  39 ++++++++
src/include/utils/date.h                        |   4 +
src/include/utils/timestamp.h                   |   4 +
src/pl/plpgsql/src/pl_exec.c                    |   3 +
src/test/regress/expected/rowsecurity.out       |  16 +--
src/test/regress/expected/rules.out             |   6 +-
src/test/regress/expected/select_views.out      |  40 ++++----
src/test/regress/expected/select_views_1.out    |  40 ++++----
24 files changed, 626 insertions(+), 168 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1bZon7-0003Nn-CQ@gemulon.postgresql.org>
Permalink:  ../E1bZon7-0003Nn-CQ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bZon7-0003Nn-CQ@gemulon.postgresql.org

 · 

reply

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 parsetree representation of special functions such as CU
  In-Reply-To: <E1bZon7-0003Nn-CQ@gemulon.postgresql.org>
  References: <E1bZon7-0003Nn-CQ@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