diff options
| author | Michael Paquier <michael@paquier.xyz> | 2022-11-21 18:31:59 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2022-11-21 18:31:59 +0900 |
| commit | f193883fc9cebe8fa20359b0797832837a788112 (patch) | |
| tree | b53cd2d5a291d6d7ec546ca645901c4ee4334fe9 /src/include/nodes/primnodes.h | |
| parent | 240e0dbacd390a8465552e27c5af11f67d747adb (diff) | |
| download | postgresql-f193883fc9cebe8fa20359b0797832837a788112.tar.gz | |
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
Diffstat (limited to 'src/include/nodes/primnodes.h')
| -rw-r--r-- | src/include/nodes/primnodes.h | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index f6dd27edcc..74f228d959 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -1293,39 +1293,6 @@ typedef struct MinMaxExpr } MinMaxExpr; /* - * SQLValueFunction - parameterless functions with special grammar productions - * - * The SQL standard categorizes some of these as <datetime value function> - * and others as <general value specification>. We call 'em SQLValueFunctions - * for lack of a better term. We store type and typmod of the result so that - * some code doesn't need to know each function individually, and because - * we would need to store typmod anyway for some of the datetime functions. - * Note that currently, all variants return non-collating datatypes, so we do - * not need a collation field; also, all these functions are stable. - */ -typedef enum SQLValueFunctionOp -{ - SVFOP_CURRENT_DATE, - SVFOP_CURRENT_TIME, - SVFOP_CURRENT_TIME_N, - SVFOP_CURRENT_TIMESTAMP, - SVFOP_CURRENT_TIMESTAMP_N, - SVFOP_LOCALTIME, - SVFOP_LOCALTIME_N, - SVFOP_LOCALTIMESTAMP, - SVFOP_LOCALTIMESTAMP_N -} SQLValueFunctionOp; - -typedef struct SQLValueFunction -{ - Expr xpr; - SQLValueFunctionOp op; /* which function this is */ - Oid type; /* result type/typmod */ - int32 typmod; - int location; /* token location, or -1 if unknown */ -} SQLValueFunction; - -/* * XmlExpr - various SQL/XML functions requiring special grammar productions * * 'name' carries the "NAME foo" argument (already XML-escaped). |
