Re: if exists? - Mailing list pgsql-general

From Shaun Thomas
Subject Re: if exists?
Date
Msg-id Pine.LNX.4.44.0205131029460.1163-100000@hamster.lee.net
Whole thread Raw
In response to if exists?  (Vincent Stoessel <vincent@xaymaca.com>)
List 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 by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: if exists?
Next
From: Steve Lane
Date:
Subject: Re: Can This be done