Re: DB creation script questions - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: DB creation script questions
Date
Msg-id 20060816191039.GF25228@phlogiston.dyndns.org
Whole thread Raw
In response to DB creation script questions  ("Jon Horsman" <horshaq@gmail.com>)
List 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@crankycanuck.ca
This work was visionary and imaginative, and goes to show that visionary
and imaginative work need not end up well.     --Dennis Ritchie


pgsql-sql by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: OT: OpenDatabase Model ?
Next
From: "Jesper K. Pedersen"
Date:
Subject: Re: OT: OpenDatabase Model ?