Re: How do I use text script containing SQL? - Mailing list pgsql-sql

From Andrew Perrin
Subject Re: How do I use text script containing SQL?
Date
Msg-id 3AA3E775.AF1CFE8@unc.edu
Whole thread Raw
In response to How do I use text script containing SQL?  ("Jeff S." <pgsqluser@yahoo.com>)
List pgsql-sql
psql <databasename>
\i filename.txt

-Andy Perrin

"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


pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [GENERAL] Date question
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] Mis-firing of rules with a WHERE condition