Re: Drop temporary table only if it exists

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Drop temporary table only if it exists
Дата
Msg-id 200302181028.01599.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: Drop temporary table only if it exists  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-sql
Jan,

> > How do I drop a temporary table ( or for that matter a sequence) only
> > if it exists  or create them if they donot exist ? I want to do this
> > to avoid any errors
>
> I wonder what type of application cannot remember if it created a temp
> object or not during the lifetime of it's database connection.

A real one, Jan.

This sort of test is particularly necessary for Exception handling routines.
One wants the exception handler to drop all temporary obejcts for a clean
slate, but since an exception has occurred, one cannot be sure which objects
were created successfully.

I've personally written several such routines.

--
-Josh BerkusAglio Database SolutionsSan Francisco



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

Предыдущее
От: "Martin Davidsson"
Дата:
Сообщение: Rule Creates Duplicates retry
Следующее
От: Jeff Eckermann
Дата:
Сообщение: Re: trigger after with cursor