Re: Support prepared statement invalidation when result types change - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Support prepared statement invalidation when result types change
Date
Msg-id 1238027.1721835596@sss.pgh.pa.us
Whole thread Raw
In response to Support prepared statement invalidation when result types change  (Jelte Fennema <me@jeltef.nl>)
Responses Re: Support prepared statement invalidation when result types change
List pgsql-hackers
Jelte Fennema <me@jeltef.nl> writes:
> The cached plan for a prepared statements can get invalidated when DDL
> changes the tables used in the query, or when search_path changes.
> ...
> However, we would throw an error if the the result of the query is of a
> different type than it was before:
> ERROR: cached plan must not change result type

Yes, this is intentional.

> This patch starts to allow a prepared statement to continue to work even
> when the result type changes.

What this is is a wire protocol break.  What if the client has
previously done a Describe Statement on the prepared statement?
We have no mechanism for notifying it that that information is
now falsified.  The error is thrown to prevent us from getting
into a situation where we'd need to do that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Detect buffer underflow in get_th()
Next
From: Tom Lane
Date:
Subject: Re: Slow catchup of 2PC (twophase) transactions on replica in LR