Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f261inx79751 for ; Mon, 5 Mar 2001 20:44:49 -0500 (EST) (envelope-from jliang@tidal.ipinc.com) Received: from localhost (jliang@localhost) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id RAA42008; Mon, 5 Mar 2001 17:44:45 -0800 (PST) (envelope-from jliang@tidal.ipinc.com) Date: Mon, 5 Mar 2001 17:44:45 -0800 (PST) From: Jie Liang To: "Jeff S." cc: pgsql-sql@postgresql.org Subject: Re: How do I use text script containing SQL? In-Reply-To: <20010305185600.44574.qmail@web12702.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200103/81 X-Sequence-Number: 1729 if you are a user with privalege can create table psql -e dbname 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 >