What is best way to query presence of a table

Поиск
Список
Период
Сортировка
От Medi Montaseri
Тема What is best way to query presence of a table
Дата
Msg-id 3E14DD31.8060706@intransa.com
обсуждение исходный текст
Список pgsql-general
What is the best way to query presence of a table

select relname from pg_class where relname = 'SomeTable';

or

select * from SomeTable    -- I know this one succss but I don't have to
wory
about pg_* changing under me....

or

select exists('SomeTable');

Where exists() is a pg built in function -- I am wishing here for a feature

I'd like to solve this such that I'm protected from internal changes
within PG.
Obviously the suggested method above similar to version() can abstract that.

Also, when I create my table, can I say create or replace (for base
tables) ?

Thanks


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_restore woes..
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_restore woes..