Re: if exists? - Mailing list pgsql-general

From Oliver Elphick
Subject Re: if exists?
Date
Msg-id 1021303908.1539.55.camel@linda
Whole thread Raw
In response to if exists?  (Vincent Stoessel <vincent@xaymaca.com>)
List pgsql-general
On Mon, 2002-05-13 at 14:33, Vincent Stoessel wrote:
> Is there an sql query that I can use on postgres that will tell
> me if a table exists?

SELECT relname
  FROM pg_class
  WHERE relname = 'your_table' AND relkind = 'r';

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C

     "Watch ye and pray, lest ye enter into temptation. The
      spirit truly is ready, but the flesh is weak."
                           Mark 14:38

Attachment

pgsql-general by date:

Previous
From: "Marin Dimitrov"
Date:
Subject: Re: if exists?
Next
From: Shaun Thomas
Date:
Subject: Re: if exists?