From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Replace SQLValueFunction by COERCE_SQL_SYNTAX
Date: Mon, 21 Nov 2022 09:32:44 +0000
Message-ID: <E1ox3AR-000C4x-AR@gemulon.postgresql.org> (raw)
Replace SQLValueFunction by COERCE_SQL_SYNTAX
This switch impacts 9 patterns related to a SQL-mandated special syntax
for function calls:
- LOCALTIME [ ( typmod ) ]
- LOCALTIMESTAMP [ ( typmod ) ]
- CURRENT_TIME [ ( typmod ) ]
- CURRENT_TIMESTAMP [ ( typmod ) ]
- CURRENT_DATE
Five new entries are added to pg_proc to compensate the removal of
SQLValueFunction to provide backward-compatibility and making this
change transparent for the end-user (for example for the attribute
generated when a keyword is specified in a SELECT or in a FROM clause
without an alias, or when specifying something else than an Iconst to
the parser).
The parser included a set of checks coming from the files in charge of
holding the C functions used for the SQLValueFunction calls (as of
transformSQLValueFunction()), which are now moved within each function's
execution path, so this reduces the dependencies between the execution
and the parsing steps. As of this change, all the SQL keywords use the
same paths for their work, relying only on COERCE_SQL_SYNTAX. Like
fb32748, no performance difference has been noticed, while the perf
profiles get reduced with ExecEvalSQLValueFunction() gone.
Bump catalog version.
Reviewed-by: Corey Huinker, Ted Yu
Discussion: https://postgr.es/m/YzaG3MoryCguUOym@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f193883fc9cebe8fa20359b0797832837a788112
Modified Files
--------------
src/backend/catalog/system_functions.sql | 26 +++++++++
src/backend/executor/execExpr.c | 11 ----
src/backend/executor/execExprInterp.c | 46 ----------------
src/backend/jit/llvm/llvmjit_expr.c | 6 --
src/backend/jit/llvm/llvmjit_types.c | 1 -
src/backend/nodes/nodeFuncs.c | 27 ++-------
src/backend/optimizer/path/costsize.c | 1 -
src/backend/optimizer/util/clauses.c | 39 +++----------
src/backend/parser/gram.y | 59 ++++++++++++--------
src/backend/parser/parse_expr.c | 52 -----------------
src/backend/parser/parse_target.c | 25 ---------
src/backend/utils/adt/date.c | 81 ++++++++++++++++-----------
src/backend/utils/adt/ruleutils.c | 92 ++++++++++++++++---------------
src/backend/utils/adt/timestamp.c | 72 ++++++++++++++----------
src/backend/utils/misc/queryjumble.c | 9 ---
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 17 ++++++
src/include/executor/execExpr.h | 8 ---
src/include/nodes/primnodes.h | 33 -----------
src/include/utils/date.h | 4 --
src/include/utils/timestamp.h | 4 --
src/test/regress/expected/expressions.out | 2 +-
src/test/regress/sql/expressions.sql | 2 +-
src/tools/pgindent/typedefs.list | 2 -
24 files changed, 231 insertions(+), 390 deletions(-)
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: michael@paquier.xyz
Subject: Re: pgsql: Replace SQLValueFunction by COERCE_SQL_SYNTAX
In-Reply-To: <E1ox3AR-000C4x-AR@gemulon.postgresql.org>
References: <E1ox3AR-000C4x-AR@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