if exists?

Поиск
Список
Период
Сортировка
От Lee Kindness
Тема if exists?
Дата
Msg-id 15583.56086.82928.173176@kelvin.csl.co.uk
обсуждение исходный текст
Ответ на if exists?  (Vincent Stoessel <vincent@xaymaca.com>)
Список pgsql-general
Vincent Stoessel writes:
 > 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.

Something like:

 SELECT COUNT(relname) FROM pg_class WHERE relname = 'tablename';

Regards, Lee Kindness

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

Предыдущее
От: "murphy pope"
Дата:
Сообщение: Re: Why is ALLOW_ABSOLUTE_DBPATHS unsafe?
Следующее
От: "Marin Dimitrov"
Дата:
Сообщение: Re: if exists?