Re: Conditional Statement

Поиск
Список
Период
Сортировка
От missive@frontiernet.net (Lee Harr)
Тема Re: Conditional Statement
Дата
Msg-id slrna885lg.55.missive@whave.frontiernet.net
обсуждение исходный текст
Ответ на Conditional Statement  (Samik Raychauhduri <samik@cae.wisc.edu>)
Список pgsql-general
> Hello,
> I am trying to write a piece of SQL code, which will first check if a
> table exist, drop it and then recreate it. I didn't see any 'IF' syntax
> in pgsql. Is there any other alternative? I tried to use 'case'
> structure, but didn't succeed.
> Thanks and regards.
> -Samik
>

Is there reason the table must not exist before you drop it?

When I write SQL scripts (to be fed in to psql) I just go ahead
and drop the table (whether it is really there or not) and if it
does not exist, there is a warning, but the script keeps running.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Changes to NOW() in 7.2?
Следующее
От: "PG"
Дата:
Сообщение: Slow in VB Grid with PG