Re: [BUGS] BUG #14483: Prepared statement does not re-plan while it should

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #14483: Prepared statement does not re-plan while it should
Дата
Msg-id 16871.1483373067@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUGS] BUG #14483: Prepared statement does not re-plan while it should  (cnliou9@fastmail.fm)
Ответы Re: [BUGS] BUG #14483: Prepared statement does not re-plan while itshould  (CN <cnliou9@fastmail.fm>)
Список pgsql-bugs
cnliou9@fastmail.fm writes:
> test=# CREATE TABLE x1 (c1 INTEGER);
> CREATE TABLE
> test=# PREPARE p1 AS SELECT * FROM x1;
> PREPARE

> (
> Run this SQL in another session:
> ALTER TABLE x1 ADD c2 TEXT;
> )

> test=# EXECUTE p1;
> ERROR:  cached plan must not change result type

This behavior is intentional: it's to keep applications from having to
deal with the possibility that they prepare a statement, Describe it
to find out what columns it returns, and then when they actually execute
it, it returns some other column set.

            regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [BUGS] BUG #14483: Prepared statement does not re-plan while it should
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] Postgres returning in-correct results with ST_DWithin()