Re: Drop temporary table only if it exists

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

> 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

A quick check for existance:
SELECT * FROM pg_class WHERE relname = 'name_of_temp_table' and relkind = ?

You'll want to look in the docs about the PG system tables to see what
"relkind" you should test on for each type of object.

--
Josh Berkus
Aglio Database Solutions
San Francisco


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

Предыдущее
От: Jeff Boes
Дата:
Сообщение: Timezone conversion
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Timezone conversion