How do I use text script containing SQL?

From: "Jeff S(dot)" <pgsqluser(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: How do I use text script containing SQL?
Date: 2001-03-05 18:56:00
Message-ID: 20010305185600.44574.qmail@web12702.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Olbersen 2001-03-05 19:08:40 Re: How do I use text script containing SQL?
Previous Message Jie Liang 2001-03-05 18:28:55 Re: