Re: alter table tablename add column - breaks pl/pgsql function returns tablename

Поиск
Список
Период
Сортировка
От Amit kapila
Тема Re: alter table tablename add column - breaks pl/pgsql function returns tablename
Дата
Msg-id 6C0B27F7206C9E4CA54AE035729E9C382854651B@szxeml509-mbx
обсуждение исходный текст
Ответ на alter table tablename add column - breaks pl/pgsql function returns tablename  (Palle Girgensohn <girgen@FreeBSD.org>)
Ответы Re: alter table tablename add column - breaks pl/pgsql function returns tablename  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wednesday, October 31, 2012 11:50 PM Palle Girgensohn  wrote:
Hash: SHA1

Hi!

> This is an old problem, referred to in bug #4907:


>ALTER TABLE test ADD COLUMN foo INTEGER;
> SELECT * FROM test_func();
> - -- ERROR:  wrong record type supplied in RETURN NEXT

> You have to run create or replace again to fix it when changing the
> schema. How come it fails? Is the return type "hardcoded" when the
> function is created?  I think it is because compiled body of function is created with that type of table. You will
notsee this problem if you reconnect or select from another new session.   
> Is this very hard to fix?
  Currently the compiled body is not discarded on DDL's, so I believe it is not a bug as per current implementation.
Howeverit can be thought of as a new feature. 

> IS there a suggested  work-around?   Considering DDL's are used less often, you can see how feasible it is for you
thatafter a DDL, you reconnect sessions which use functions.   I know this is not good workaround, but I am sorry
nothingelse comes to my mind for now. 
   Anybody else can think of any other better workarounds for this problem?

With Regards,
Amit Kapila.


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Preserve intermediate .c files in coverage mode
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Synchronous commit not... synchronous?