Re: if exists?

Поиск
Список
Период
Сортировка
От Shaun Thomas
Тема Re: if exists?
Дата
Msg-id Pine.LNX.4.44.0205131029460.1163-100000@hamster.lee.net
обсуждение исходный текст
Ответ на 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?

SELECT COUNT(1) FROM pg_tables WHERE tablename='whatever';

For more information, type \dS in your psql client.  It will show you
the many system tables that contain information and various sundry
things about your postgres database/installation.

--
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Shaun M. Thomas                INN Database Administrator           |
| Phone: (309) 743-0812          Fax  : (309) 743-0830                |
| Email: sthomas@townnews.com    AIM  : trifthen                      |
| Web  : www.townnews.com                                             |
|                                                                     |
|     "Most of our lives are about proving something, either to       |
|      ourselves or to someone else."                                 |
|                                           -- Anonymous              |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+



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

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: if exists?
Следующее
От: Steve Lane
Дата:
Сообщение: Re: Can This be done