Code review for protransform patches.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 23 Mar 2012 21:29:57 +0000 (17:29 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 23 Mar 2012 21:29:57 +0000 (17:29 -0400)
commit0339047bc93147c1c6f78f867ae6b0c215406235
tree116a4cd10a9eb1b0b6beb4cf871bc126c504572a
parente08b4101e1daa2f4e6644330918177a10cac0aab
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.
15 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/xfunc.sgml
src/backend/nodes/nodeFuncs.c
src/backend/optimizer/util/clauses.c
src/backend/parser/parse_clause.c
src/backend/utils/adt/datetime.c
src/backend/utils/adt/numeric.c
src/backend/utils/adt/timestamp.c
src/backend/utils/adt/varbit.c
src/backend/utils/adt/varchar.c
src/include/catalog/pg_proc.h
src/include/nodes/nodeFuncs.h
src/include/parser/parse_clause.h
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/opr_sanity.sql