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