Re: How do I use text script containing SQL?

From: Jie Liang <jliang(at)ipinc(dot)com>
To: "Jeff S(dot)" <pgsqluser(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How do I use text script containing SQL?
Date: 2001-03-06 01:44:45
Message-ID: Pine.BSF.4.10.10103051742420.41818-100000@tidal.ipinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


if you are a user with privalege can create table

psql -e dbname<filename.txt

Jie LIANG

St. Bernard Software

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang(at)ipinc(dot)com
www.stbernard.com
www.ipinc.com

On Mon, 5 Mar 2001, 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(at)postgresql(dot)org
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Sawtell 2001-03-06 02:14:59 Re: count number of weeks??
Previous Message Boulat Khakimov 2001-03-05 23:57:52 Re: Extending PostgreSQL Using C