Re: if exists?

From: Shaun Thomas <sthomas(at)townnews(dot)com>
To: Vincent Stoessel <vincent(at)xaymaca(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: if exists?
Date: 2002-05-13 15:33:35
Message-ID: Pine.LNX.4.44.0205131029460.1163-100000@hamster.lee.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)townnews(dot)com AIM : trifthen |
| Web : www.townnews.com |
| |
| "Most of our lives are about proving something, either to |
| ourselves or to someone else." |
| -- Anonymous |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

In response to

  • if exists? at 2002-05-13 13:33:38 from Vincent Stoessel

Browse pgsql-general by date

  From Date Subject
Next Message Marco Lima 2002-05-13 15:51:03 Periodic execution of functions
Previous Message Oliver Elphick 2002-05-13 15:31:48 Re: if exists?