Re: How do I drop something that might not exist?

Поиск
Список
Период
Сортировка
От Leif B. Kristensen
Тема Re: How do I drop something that might not exist?
Дата
Msg-id 200903191540.12533.leif@solumslekt.org
обсуждение исходный текст
Ответ на How do I drop something that might not exist?  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
Список pgsql-novice
On Thursday 19. March 2009, Rob Richardson wrote:
>I tried using an if statement combined with the EXISTS() function:
>
>if exists(select 1 from this_sequence_does_not_exist) then
>    drop sequence this_sequence_does_not_exist;
>end if;

I don't know if it applies to your particular problem, but the standard
SQL if-then-else construct is:

CASE WHEN foo THEN bar ELSE baz;

HTH,
--
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/

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

Предыдущее
От: kulmacet101@kulmacet.com
Дата:
Сообщение: Re: Check if table exists
Следующее
От: David Saracini
Дата:
Сообщение: Re: How do I drop something that might not exist?