From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pg_analyze_and_rewrite_varparams()
Date: Mon, 07 Mar 2022 07:31:45 +0000
Message-ID: <E1nR7qL-001Iqk-8T@gemulon.postgresql.org> (raw)
Add pg_analyze_and_rewrite_varparams()
This new function extracts common code from PrepareQuery() and
exec_parse_message(). It is then exactly analogous to the existing
pg_analyze_and_rewrite_fixedparams() and
pg_analyze_and_rewrite_withcb().
To unify these two code paths, this makes PrepareQuery() now subject
to log_parser_stats. Also, both paths now invoke
TRACE_POSTGRESQL_QUERY_REWRITE_START(). PrepareQuery() no longer
checks whether a utility statement was specified. The grammar doesn't
allow that anyway, and exec_parse_message() supports it, so
restricting it doesn't seem necessary.
This also adds QueryEnvironment support to the *varparams functions,
for consistency with its cousins, even though it is not used right
now.
Reviewed-by: Nathan Bossart <bossartn@amazon.com>
Discussion: https://www.postgresql.org/message-id/flat/c67ce276-52b4-0239-dc0e-39875bf81840@enterprisedb.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/25751f54b8e02a8fff62e9dbdbc9f2efbb4e8dc1
Modified Files
--------------
src/backend/commands/prepare.c | 43 ++-----------------
src/backend/parser/analyze.c | 5 ++-
src/backend/tcop/postgres.c | 95 ++++++++++++++++++++++++++++--------------
src/include/parser/analyze.h | 2 +-
src/include/tcop/tcopprot.h | 5 +++
5 files changed, 78 insertions(+), 72 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: peter@eisentraut.org
Subject: Re: pgsql: Add pg_analyze_and_rewrite_varparams()
In-Reply-To: <E1nR7qL-001Iqk-8T@gemulon.postgresql.org>
References: <E1nR7qL-001Iqk-8T@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