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: Teach eval_const_expressions() to handle some more cases.
Date: Wed, 03 Jan 2018 17:35:26 +0000
Message-ID: <E1eWmwo-0002MN-Mp@gemulon.postgresql.org> (raw)

Teach eval_const_expressions() to handle some more cases.

Add some infrastructure (mostly macros) to make it easier to write
typical cases for constant-expression simplification.  Add simplification
processing for ArrayRef, RowExpr, and ScalarArrayOpExpr node types,
which formerly went unsimplified even if all their inputs were constants.
Also teach it to simplify FieldSelect from a composite constant.
Make use of the new infrastructure to reduce the amount of code needed
for the existing ArrayExpr and ArrayCoerceExpr cases.

One existing test case changes output as a result of the fact that
RowExpr can now be folded to a constant.  All the new code is exercised
by existing test cases according to gcov, so I feel no need to add
additional tests.

Tom Lane, reviewed by Dmitry Dolgov

Discussion: https://postgr.es/m/3be3b82c-e29c-b674-2163-bf47d98817b1@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3decd150a2d5a8f8d43010dd0c207746ba946303

Modified Files
--------------
src/backend/optimizer/util/clauses.c   | 219 ++++++++++++++++++++++-----------
src/test/regress/expected/rowtypes.out |   6 +-
2 files changed, 150 insertions(+), 75 deletions(-)



Message-ID: <E1eWmwo-0002MN-Mp@gemulon.postgresql.org>
Permalink:  ../E1eWmwo-0002MN-Mp@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1eWmwo-0002MN-Mp@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: Teach eval_const_expressions() to handle some more cases.
  In-Reply-To: <E1eWmwo-0002MN-Mp@gemulon.postgresql.org>
  References: <E1eWmwo-0002MN-Mp@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