]> granicus.if.org Git - postgresql/commit
Improve parsetree representation of special functions such as CURRENT_DATE.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Aug 2016 00:33:01 +0000 (20:33 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Aug 2016 00:33:01 +0000 (20:33 -0400)
commit0bb51aa96783e8a6c473c2b5e3725e23e95db834
treef4d4077257f5a4937fefafd0fe6f914f5e4027fd
parent4bc4cfe3bd186b4a1d1b01279bfd0e6ab11268b2
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>
24 files changed:
contrib/pg_stat_statements/pg_stat_statements.c
src/backend/executor/execQual.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/nodeFuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/util/clauses.c
src/backend/parser/gram.y
src/backend/parser/parse_expr.c
src/backend/parser/parse_target.c
src/backend/utils/adt/date.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/timestamp.c
src/include/catalog/catversion.h
src/include/nodes/nodes.h
src/include/nodes/primnodes.h
src/include/utils/date.h
src/include/utils/timestamp.h
src/pl/plpgsql/src/pl_exec.c
src/test/regress/expected/rowsecurity.out
src/test/regress/expected/rules.out
src/test/regress/expected/select_views.out
src/test/regress/expected/select_views_1.out