public inbox for [email protected]  
help / color / mirror / Atom feed
From: Vladimir Sitnikov <[email protected]>
To: Igor Korot <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: pgsql-generallists.postgresql.org <[email protected]>
Cc: Rob Sargent <[email protected]>
Subject: Re: Double prepare
Date: Sat, 16 May 2026 17:37:38 +0300
Message-ID: <CAB=Je-EG4j-MUGRdQbRVuNNz=eLUa3b-zhi7Zw+seaOY4SdN7w@mail.gmail.com> (raw)
In-Reply-To: <CAB=Je-HxpyNNbn7girF6Mouf4gmzNQN=jdkrM49VwEtT_uFf4w@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<CAB=Je-HxpyNNbn7girF6Mouf4gmzNQN=jdkrM49VwEtT_uFf4w@mail.gmail.com>

A couple more things to keep in mind:
1) The client has to re-prepare statements on "deallocate all", "alter",
"create", "drop", "alter", "set search_path" statements.
The backend does not automatically keep the prepared statement workable
across those calls.
The offending error messages are "ERROR: cached plan must not change result
type", "ERROR: prepared statement "S_2" does not exist"

2) I've an answer regarding "prepared statement lifespan" at
https://stackoverflow.com/questions/32297503/whats-the-life-span-of-a-postgresql-server-side-prepare...
Looking forward to adding more references there. Feel free pinging me in
the comments.

Vladimir


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], [email protected]
  Subject: Re: Double prepare
  In-Reply-To: <CAB=Je-EG4j-MUGRdQbRVuNNz=eLUa3b-zhi7Zw+seaOY4SdN7w@mail.gmail.com>

* 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