Re: if exists? - Mailing list pgsql-general

From Dave Carrigan
Subject Re: if exists?
Date
Msg-id 87it5s6mv7.fsf@cbgb.rudedog.org
Whole thread Raw
In response to if exists?  (Vincent Stoessel <vincent@xaymaca.com>)
List pgsql-general
Vincent Stoessel <vincent@xaymaca.com> writes:

> Is there an sql query that I can use on postgres that will tell
> me if a table exists? I'm writing a perl script thatr creates a table.
> But I want it to rename a table with the same name if it finds an
> existing one.

Run 'psql -E', do a \dt, and it will show you the queries it uses to
enumerate the tables.

--
Dave Carrigan (dave@rudedog.org)            | Yow! My Aunt MAUREEN was a
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | military advisor to IKE & TINA
Seattle, WA, USA                            | TURNER!!
http://www.rudedog.org/                     |

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: if exists?
Next
From: Uros Gruber
Date:
Subject: Re: don't know how to get SELECT