Received: from marketingchallenge.com (marketingchallenge.com [64.40.111.205] (may be forged)) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f25J8Rx24324 for ; Mon, 5 Mar 2001 14:08:27 -0500 (EST) (envelope-from drfrog@smartt.com) Received: (qmail 16710 invoked from network); 5 Mar 2001 19:08:25 -0000 Received: from clayton-cottingham.imc (HELO smartt.com) (drfrog@10.1.4.1) by marketingchallenge.com with SMTP; 5 Mar 2001 19:08:25 -0000 Message-ID: <3AA3E4A2.5DDC38A9@smartt.com> Date: Mon, 05 Mar 2001 11:10:26 -0800 From: clayton cottingham X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.17-21mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: "Jeff S." CC: pgsql-sql@postgresql.org Subject: Re: How do I use text script containing SQL? References: <20010305185600.44574.qmail@web12702.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200103/55 X-Sequence-Number: 1700 "Jeff S." wrote: > > I want to build my tables by placing all the sql > statements in a file. What is the correct way to use > this file with psql? > > Example: My text file has this in it: > > CREATE TABLE table1 ( > table1_id serial, > field1 char(5), > PRIMARY KEY (table1_id) > ); > > I want to be able to use the file to create my table. > I've tried psql -d databasename -e < filename.txt > but that doesn't work. > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org the syntax is psql database < file