public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Sebastien Flaesch <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: prepared statement "cu1" already exists (but it does not)
Date: Mon, 08 Apr 2024 13:36:51 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <AM9P191MB1286601145DE06E7B0D3DA57B0002@AM9P191MB1286.EURP191.PROD.OUTLOOK.COM>
References: <AM9P191MB1286DAAE95E27A8FB79376D5B0002@AM9P191MB1286.EURP191.PROD.OUTLOOK.COM>
<AM9P191MB1286601145DE06E7B0D3DA57B0002@AM9P191MB1286.EURP191.PROD.OUTLOOK.COM>
Sebastien Flaesch <[email protected]> writes:
> I understand that the whole TX is aborted with PostgreSQL, and probably the deallocate is useless since stmt was prepared inside the TX?
As you can quickly discover with some manual experimentation,
both PREPARE and DEALLOCATE are nontransactional, in the sense
that if they succeed then the prepared statement will exist
(or not) even if the surrounding transaction block is later
rolled back. This is pretty weird, and undocumented I think,
in terms of their role as SQL statements.
It makes a little more sense if you think about the equivalent
wire-protocol-level operations, which are meant to be used
by low-level client code that may not be aware of whether
there is a transaction block in progress.
> Is it an issue if I use the same name for a prepared statement and the server cursor? I mean:
From memory, I think those share the same "portal" namespace.
regards, tom lane
view thread (3+ 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]
Subject: Re: prepared statement "cu1" already exists (but it does not)
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