Re: Temporary tables inside functions problem

Поиск
Список
Период
Сортировка
От Ian Barwick
Тема Re: Temporary tables inside functions problem
Дата
Msg-id 200306082154.59758.barwick@gmx.net
обсуждение исходный текст
Ответ на Temporary tables inside functions problem  (Avi Schwartz <avi@CFFtechnologies.com>)
Список pgsql-general
On Sunday 08 June 2003 01:50, Avi Schwartz wrote:
(...)
> It seems that the error occurs not when creating the temporary tables,
> but rather when attempting to insert into them.
>
> I am sure there is a logical explanation, although I can find it.  Any
> idea what is the problem and how I can fix it?

Possibly this item from the FAQ might help:
http://www.postgresql.org/docs/faqs/FAQ.html#4.26

4.26) Why can't I reliably create/drop temporary tables in PL/PgSQL functions?

PL/PgSQL caches function contents, and an unfortunate side effect is that if a
PL/PgSQL function accesses a temporary table, and that table is later dropped
and recreated, and the function called again, the function will fail because
the cached function contents still point to the old temporary table. The
solution is to use EXECUTE for temporary table access in PL/PgSQL. This will
cause the query to be reparsed every time.


Ian Barwick
barwick@gmx.net


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

Предыдущее
От: Steve Lane
Дата:
Сообщение: Re: Backups and restores.
Следующее
От: Arjen van der Meijden
Дата:
Сообщение: Re: Linux 2.6 kernel,