Re: if exists?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: if exists?
Дата
Msg-id Pine.LNX.4.33.0205131124220.18289-100000@css120.ihs.com
обсуждение исходный текст
Ответ на if exists?  (Vincent Stoessel <vincent@xaymaca.com>)
Список pgsql-general
On Mon, 13 May 2002, Vincent Stoessel wrote:

> Is there an sql query that I can use on postgres that will tell
> me if a table exists? I'm writing a perl script thatr creates a table.
> But I want it to rename a table with the same name if it finds an
> existing one.

select 1 from pg_tables where tablename='tablethatmayexist';

If you get back a 1, it exists, if you get back no rows, it doesn't.


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

Предыдущее
От: Jérôme Tollet
Дата:
Сообщение: INT UNSIGNED problem
Следующее
От: Dave Carrigan
Дата:
Сообщение: Re: if exists?