Re: cached plan must not change result type - Mailing list pgsql-jdbc

From Laurenz Albe
Subject Re: cached plan must not change result type
Date
Msg-id 29759a95d5194d1a5a468e2585e363a313c7d287.camel@cybertec.at
Whole thread Raw
In response to Re: cached plan must not change result type  (Dave Cramer <davecramer@postgres.rocks>)
Responses Re: cached plan must not change result type  (James Pang <jamespang886@gmail.com>)
List pgsql-jdbc
On Sat, 2024-03-30 at 08:27 -0400, Dave Cramer wrote:
> > On Fri, 29 Mar 2024 at 19:42, James Pang <jamespang886@gmail.com> wrote:
> > > we did DDL "alter table ... alter column increase varchar(512) to varchar(1024)",
> > > after that done, hours later, new query select on this table still failed this error.
> > > From this https://jdbc.postgresql.org/documentation/server-prepare/#re-execution-of-failed-statements ,
> > > looks like pgjdbc try to handle this exception and retry, but in our case, it did not happen.
> > > Could you direct me how to make this retry work?
> > > we only want new transactions,queries work that after the DDL changes. 
>
> I think the best option for you is to turn off server side prepared statements with prepareThreshold=0

An alternative option is to take downtime for DDL and restart the application.
Or to chppse the appropriate data type right away: in your case, that would
have been "text".

Yours,
Laurenz Albe



pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: cached plan must not change result type
Next
From: James Pang
Date:
Subject: Re: cached plan must not change result type