Skip site navigation (1) Skip section navigation (2)

pgsql: Code review for protransform patches.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Code review for protransform patches.
Date: 2012-03-23 21:30:19
Message-ID: E1SBC3v-00053a-HK@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Code review for protransform patches.

Fix loss of previous expression-simplification work when a transform
function fires: we must not simply revert to untransformed input tree.
Instead build a dummy FuncExpr node to pass to the transform function.
This has the additional advantage of providing a simpler, more uniform
API for transform functions.

Move documentation to a somewhat less buried spot, relocate some
poorly-placed code, be more wary of null constants and invalid typmod
values, add an opr_sanity check on protransform function signatures,
and some other minor cosmetic adjustments.

Note: although this patch touches pg_proc.h, no need for catversion
bump, because the changes are cosmetic and don't actually change the
intended catalog contents.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0339047bc93147c1c6f78f867ae6b0c215406235

Modified Files
--------------
doc/src/sgml/catalogs.sgml               |    3 +-
doc/src/sgml/xfunc.sgml                  |   34 +++++++++
src/backend/nodes/nodeFuncs.c            |   29 +++++++-
src/backend/optimizer/util/clauses.c     |  115 +++++++++++++-----------------
src/backend/parser/parse_clause.c        |   22 ------
src/backend/utils/adt/datetime.c         |   29 ++++----
src/backend/utils/adt/numeric.c          |   23 +++---
src/backend/utils/adt/timestamp.c        |   30 +++-----
src/backend/utils/adt/varbit.c           |   23 +++---
src/backend/utils/adt/varchar.c          |   26 ++++----
src/include/catalog/pg_proc.h            |   23 +++---
src/include/nodes/nodeFuncs.h            |    1 +
src/include/parser/parse_clause.h        |    2 -
src/test/regress/expected/opr_sanity.out |   10 +++
src/test/regress/sql/opr_sanity.sql      |    7 ++
15 files changed, 205 insertions(+), 172 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2012-03-23 23:16:09
Subject: pgsql: Refactor simplify_function et al to centralize argumentsimplifi
Previous:From: Tom LaneDate: 2012-03-23 16:52:31
Subject: Re: [COMMITTERS] pgsql: Add notion of a "transform function" that can simplify function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group