Skip site navigation (1) Skip section navigation (2)

Re: Create tables in one query

From: "Albert REINER" <areiner(at)tph(dot)tuwien(dot)ac(dot)at>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Create tables in one query
Date: 2000-11-23 17:28:53
Message-ID: 20001123182853.B2673@frithjof (view raw or flat)
Thread:
Lists: pgsql-sql
On Thu, Nov 23, 2000 at 11:40:52AM -0500, bmccoy(at)chapelperilous(dot)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(at)tph(dot)tuwien(dot)ac(dot)at>
Deutsch       *       English       *       Esperanto       *       Latine
--------------------------------------------------------------------------

In response to

pgsql-sql by date

Next:From: Peter EisentrautDate: 2000-11-23 18:31:36
Subject: Re: psql question
Previous:From: Tom LaneDate: 2000-11-23 17:26:49
Subject: Re: [INTERFACES] PQendcopy: resetting connection error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group