Re: Create tables in one query - Mailing list pgsql-sql

From Albert REINER
Subject Re: Create tables in one query
Date
Msg-id 20001123182853.B2673@frithjof
Whole thread Raw
In response to Re: Create tables in one query  (<bmccoy@chapelperilous.net>)
List pgsql-sql
On Thu, Nov 23, 2000 at 11:40:52AM -0500, bmccoy@chapelperilous.net wrote:
> On Thu, 23 Nov 2000, Tomasz Gralewski wrote:
> 
> > I'd like to create a few tables in one SQL query, is that possible.
> > What tools I have to use, Perl, Tcl, or maybe is there block command
> > separator that I can write:
> > CREATE TABLE abd
> >  (
> >     a    type,
> >     b    type,
> >     c    type
> >  ) and I whant to add the next table here, how can I separate, by this (";"
> > that;s the end of table abd).
> 
> Not sure what you are trying to do here.  You can put statements like
...
> in a single file and load the file into psql via \i.  That's I build all
> of my databases.

Or, if you are concerned with possible failures: enclose the series of
CREATEs in a transaction.

Albert.


-- 

--------------------------------------------------------------------------
Albert Reiner                                   <areiner@tph.tuwien.ac.at>
Deutsch       *       English       *       Esperanto       *       Latine
--------------------------------------------------------------------------


pgsql-sql by date:

Previous
From: Adrian Phillips
Date:
Subject: Re: psql question
Next
From: Tom Lane
Date:
Subject: Re: 7.0.3 BUG