diff options
author | Peter Eisentraut | 2022-03-04 13:49:37 +0000 |
---|---|---|
committer | Peter Eisentraut | 2022-03-04 13:50:22 +0000 |
commit | 791b1b71da35d9d4264f72a87e4078b85a2fcfb4 (patch) | |
tree | 016287b8c51ff0d9d591bceed27f7b223d46a8d0 /src/backend/commands/copyto.c | |
parent | d816f366bc427cacba29c1e4b1696afa620e73a7 (diff) |
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 <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Diffstat (limited to 'src/backend/commands/copyto.c')
-rw-r--r-- | src/backend/commands/copyto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/copyto.c b/src/backend/commands/copyto.c index 3283ef50d06..55c38b04c45 100644 --- a/src/backend/commands/copyto.c +++ b/src/backend/commands/copyto.c @@ -439,7 +439,7 @@ BeginCopyTo(ParseState *pstate, * Run parse analysis and rewrite. Note this also acquires sufficient * locks on the source table(s). */ - rewritten = pg_analyze_and_rewrite(raw_query, + rewritten = pg_analyze_and_rewrite_fixedparams(raw_query, pstate->p_sourcetext, NULL, 0, NULL); |