- Архив списков рассылки pgsql-hackers

Поиск
Список
Период
Сортировка
От James Robinson
Тема
Дата
Msg-id 0E52590C-3DD9-418A-97D2-054CF8DCCC69@socialserve.com
обсуждение исходный текст
Список pgsql-hackers
 > After reconnecting to database all is ok. Is it supposed behaviour?

Yes. The plpgsql interpreter in the backend directs the backend to  
prepare and cache every sql statement in the function. The planned  
statements reference oids of the tables referenced.

Dropping the connection gets rid of the (now invalid) cached plan.

People have proposed some sort of reparse / replan command, but I  
don't know if they could gain consensus.

It'd be really fancy if plpgsql could sniff into the plan structure  
of each planned query, looking for table oids, and then registering  
itself as being a dependent object of that table, so that upon table  
drop the planned function body could be abandoned, and upon next call  
to the function, hopefully the  table might have been recreated, and  
then the function gets planned successfully again. Or, if the table  
does not exist yet, then it just fails as normal.

----
James Robinson
Socialserve.com



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

Предыдущее
От: Patrick Welche
Дата:
Сообщение: Re: inet increment with int
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: PL/PGSQL and drop/create table