git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: d816f36) | patch
Parse/analyze function renaming
Fri, 4 Mar 2022 13:49:37 +0000 (14:49 +0100)
Fri, 4 Mar 2022 13:50:22 +0000 (14:50 +0100)
commit 791b1b71da35d9d4264f72a87e4078b85a2fcfb4
Parse/analyze function renaming

There are three parallel ways to call parse/analyze: with fixed
parameters, with variable parameters, and by supplying your own parser
callback. Some of the involved functions were confusingly named and
made this API structure more confusing. This patch renames some
functions to make this clearer:

parse_analyze() -> parse_analyze_fixedparams()
pg_analyze_and_rewrite() -> pg_analyze_and_rewrite_fixedparams()

(Otherwise one might think this variant doesn't accept parameters, but
in fact all three ways accept parameters.)

pg_analyze_and_rewrite_params() -> pg_analyze_and_rewrite_withcb()

(Before, and also when considering pg_analyze_and_rewrite(), one might
think this is the only way to pass parameters. Moreover, the parser
callback doesn't necessarily need to parse only parameters, it's just
one of the things it could do.)

parse_fixed_parameters() -> setup_parse_fixed_parameters()
parse_variable_parameters() -> setup_parse_variable_parameters()

(These functions don't actually do any parsing, they just set up
callbacks to use during parsing later.)

This patch also adds some const decorations to the fixed-parameters
API, so the distinction from the variable-parameters API is more
clear.

Reviewed-by: Nathan Bossart <bossartn@amazon.com>
Discussion: https://www.postgresql.org/message-id/flat/c67ce276-52b4-0239-dc0e-39875bf81840@enterprisedb.com
17 files changed:
src/backend/catalog/pg_proc.c diff | blob | blame | history
src/backend/commands/copyto.c diff | blob | blame | history
src/backend/commands/extension.c diff | blob | blame | history
src/backend/commands/schemacmds.c diff | blob | blame | history
src/backend/commands/tablecmds.c diff | blob | blame | history
src/backend/commands/view.c diff | blob | blame | history
src/backend/executor/functions.c diff | blob | blame | history
src/backend/executor/spi.c diff | blob | blame | history
src/backend/optimizer/util/clauses.c diff | blob | blame | history
src/backend/parser/analyze.c diff | blob | blame | history
src/backend/parser/parse_param.c diff | blob | blame | history
src/backend/parser/parse_utilcmd.c diff | blob | blame | history
src/backend/tcop/postgres.c diff | blob | blame | history
src/backend/utils/cache/plancache.c diff | blob | blame | history
src/include/parser/analyze.h diff | blob | blame | history
src/include/parser/parse_param.h diff | blob | blame | history
src/include/tcop/tcopprot.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /