Re: cached plan must not change result type

Поиск
Список
Период
Сортировка
От James Pang
Тема Re: cached plan must not change result type
Дата
Msg-id CAHgTRfe+REHqYoQJ_ykj_p416PbdHz+UN06-R3PVr6auMx4w2g@mail.gmail.com
обсуждение исходный текст
Ответы Re: cached plan must not change result type
Список pgsql-jdbc

Thanks Laurenz,  forwarded to pgjdbc,  we want to understand why JDBC failed to reexecute the SQL instead of throw error out. Like this document https://jdbc.postgresql.org/documentation/server-prepare/#re-execution-of-failed-statements .

 

Thanks,

 

James 


Laurenz Albe <laurenz.albe@cybertec.at> 於 2024年3月29日週五 下午4:40寫道:
On Fri, 2024-03-29 at 10:05 +0800, James Pang wrote:
> PGV14, client use PGJDBC driver and prepared statements, when a table
> "alter table alter column type ..." changes done, a lot of JDBC clients
> got this error "cached plan must not change result type".  when a JDBC
> client got this error first time after the DDL schema change, JDBC driver
> will clear this caching-plan and following same SQL statement got parsing
> again and new cached plan right?

Not sure; what do you observe?
Anyway, this is a known problem:
https://jdbc.postgresql.org/documentation/server-prepare/#ddl

> How to avoid this issue when DDL schema changes ?

Don't use server-side prepared statements:
https://jdbc.postgresql.org/documentation/server-prepare/#deactivation
You'll lose some performance though.

Questions like this had better be asked on the pgsql-jdbc list.

Yours,
Laurenz Albe

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Chapman Flack
Дата:
Сообщение: Re: Java : Postgres double precession issue with different data format text and binary
Следующее
От: James Pang
Дата:
Сообщение: Re: cached plan must not change result type