Internal error with types changes and prepared statements

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Internal error with types changes and prepared statements
Дата
Msg-id CA+mi_8YAGf9qibDFTRNKgaTwaBa1OUcteKqLAxfMmKFbo3GHZg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Internal error with types changes and prepared statements  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
From https://github.com/sqlalchemy/sqlalchemy/issues/6842#issuecomment-925131836

The issue can be reproduced in psql with the following commands
(tested with PostgreSQL 12.8):

BEGIN;
CREATE TYPE an_enum AS ENUM ('foo', 'bar', 'baz');
CREATE TABLE foo(id integer, bar an_enum[]);
PREPARE stmt (an_enum[]) AS INSERT INTO foo (bar) VALUES ($1);
EXECUTE stmt ('{foo}');
ROLLBACK;

BEGIN;
CREATE TYPE an_enum AS ENUM ('foo', 'bar', 'baz');
CREATE TABLE foo(id integer, bar an_enum[]);
EXECUTE stmt ('{foo}');
ERROR:  cache lookup failed for type 8072147

\errverbose
ERROR:  XX000: cache lookup failed for type 8072147
LOCATION:  getBaseTypeAndTypmod, lsyscache.c:2355

Note: the issue is caused by Psycopg 3 use of prepared statements. Do
you suggest discarding prepared statements on a rollback on the
connection? I haven't seen documentation describing the interaction
between transactions and prepared statements.

Cheers

-- Daniele



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17200: PostgreSQL-Support Profile Guide Optimization(Clang/GCC)?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Internal error with types changes and prepared statements