public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alvaro Herrera <[email protected]>
To: Yugo NAGATA <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Fabien COELHO <[email protected]>
Cc: [email protected]
Subject: Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
Date: Mon, 12 Sep 2022 17:03:43 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 2022-Mar-28, Yugo NAGATA wrote:
> On Fri, 25 Mar 2022 16:19:54 -0400
> Tom Lane <[email protected]> wrote:
> > I am not convinced this is a great idea. The current behavior is that
> > a statement is not prepared until it's about to be executed, and I think
> > we chose that deliberately to avoid semantic differences between prepared
> > and not-prepared mode. For example, if a script looks like
> >
> > CREATE FUNCTION foo(...) ...;
> > SELECT foo(...);
> > DROP FUNCTION foo;
> >
> > trying to prepare the SELECT in advance would lead to failure.
> >
> > We could perhaps get away with preparing the commands within a pipeline
> > just before we start to execute the pipeline, but it looks to me like
> > this patch tries to prepare the entire script in advance.
Maybe it would work to have one extra boolean in struct Command, indicating
that the i-th command in the script is inside a pipeline; in -M
prepared, issue PREPARE for each command marked with that flag ahead of
time, and for all other commands, do as today. That way, we don't
change behavior for anything except those commands that need the change.
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Digital and video cameras have this adjustment and film cameras don't for the
same reason dogs and cats lick themselves: because they can." (Ken Rockwell)
view thread (14+ messages) latest in thread
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox