Received: from frithjof.reiner (c57.dialin.tuwien.ac.at [192.35.243.67]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eAOH3kA48704 for ; Fri, 24 Nov 2000 12:03:47 -0500 (EST) (envelope-from areiner@tph.tuwien.ac.at) Received: (qmail 2898 invoked by uid 500); 23 Nov 2000 17:28:53 -0000 From: "Albert REINER" Date: Thu, 23 Nov 2000 18:28:53 +0100 To: pgsql-sql@postgresql.org Subject: Re: Create tables in one query Message-ID: <20001123182853.B2673@frithjof> Mail-Followup-To: pgsql-sql@postgresql.org References: <00Nov23.150256met.40330@deuter.bhv.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: ; from bmccoy@chapelperilous.net on Thu, Nov 23, 2000 at 11:40:52AM -0500 X-Archive-Number: 200011/222 X-Sequence-Number: 253 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 Deutsch * English * Esperanto * Latine --------------------------------------------------------------------------