Re: Double prepare

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: Igor Korot <ikorot01(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, Rob Sargent <robjsargent(at)gmail(dot)com>
Subject: Re: Double prepare
Date: 2026-05-16 14:37:38
Message-ID: CAB=Je-EG4j-MUGRdQbRVuNNz=eLUa3b-zhi7Zw+seaOY4SdN7w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

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-prepared-statement/32300222#32300222
Looking forward to adding more references there. Feel free pinging me in
the comments.

Vladimir

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2026-05-17 02:29:03 Disconnecting from the server
Previous Message Vladimir Sitnikov 2026-05-16 14:31:49 Re: Double prepare