Subject: Re: Support prepared statement invalidation when result types change

From: Jelte Fennema <[email-masked]>
Date: Mon, 28 Aug 2023 18:47:59 +0200

On Mon, 28 Aug 2023 at 15:05, Konstantin Knizhnik <[email-masked]> wrote:
> The following assignment of format is not corrects:
>
> It has to be copied as below:
>
>      portal->formats = (int16 *)
>          MemoryContextAlloc(portal->portalContext,
>                             natts * sizeof(int16));
>          memcpy(portal->formats, formats, natts * sizeof(int16));

I attached a new version of the patch where I now did this. But I also
moved the code around quite a bit, since all this tupDesc/format
delaying is only needed for exec_simple_query. The original changes
actually broke some prepared statements that were using protocol level
Bind messages.