Re: DB creation script questions

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: DB creation script questions
Date: 2006-08-16 19:10:39
Message-ID: 20060816191039.GF25228@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Aug 16, 2006 at 02:44:58PM -0400, Jon Horsman wrote:
> I have previously used MySQL and was able to accomplish this very
> simply using IF NOT EXISTS for the table and database creation but
> this doesn't seem to be available for postgres and i'm looking for a
> more robust solution anyways.

Well, you could query the SQL-standard Information Schema.
Alternatively, you can query the system tables like pg_class. But if
you want the more standard one, use the tables under schema
information_schema. That's the reason there's a standard.

A

--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
This work was visionary and imaginative, and goes to show that visionary
and imaginative work need not end up well.
--Dennis Ritchie

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jesper K. Pedersen 2006-08-16 20:03:38 Re: OT: OpenDatabase Model ?
Previous Message Andrew Sullivan 2006-08-16 19:07:24 Re: OT: OpenDatabase Model ?