Received: from web12702.mail.yahoo.com (web12702.mail.yahoo.com [216.136.173.239]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f25Iu1x21860 for ; Mon, 5 Mar 2001 13:56:01 -0500 (EST) (envelope-from pgsqluser@yahoo.com) Message-ID: <20010305185600.44574.qmail@web12702.mail.yahoo.com> Received: from [216.54.52.159] by web12702.mail.yahoo.com; Mon, 05 Mar 2001 10:56:00 PST Date: Mon, 5 Mar 2001 10:56:00 -0800 (PST) From: "Jeff S." Subject: How do I use text script containing SQL? To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200103/54 X-Sequence-Number: 1699 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/