Re: if exists?

From: Dave Carrigan <dave(at)rudedog(dot)org>
To: Vincent Stoessel <vincent(at)xaymaca(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: if exists?
Date: 2002-05-13 16:20:12
Message-ID: 87it5s6mv7.fsf@cbgb.rudedog.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vincent Stoessel <vincent(at)xaymaca(dot)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(at)rudedog(dot)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/ |

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 Randall Perry 2002-05-13 16:56:51 Re: Serious environment problem with 7.2 on Solaris
Previous Message McCaffity, Ray (Contractor) 2002-05-13 16:15:04 Re: Serious environment problem with 7.2 on Solaris