pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: clayton cottingham <drfrog@smartt.com>
To: Jeff S. <pgsqluser@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: How do I use text script containing SQL?
Date: Mon, 05 Mar 2001 11:10:26 -0800
Message-ID: <3AA3E4A2.5DDC38A9@smartt.com> (raw)
References: <20010305185600.44574.qmail@web12702.mail.yahoo.com>

"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



the  syntax is 
psql database < file



view thread (6+ messages)  latest in thread

Message-ID: <3AA3E4A2.5DDC38A9@smartt.com>
Permalink:  ../3AA3E4A2.5DDC38A9@smartt.com/
Also on:    postgresql.org/message-id/3AA3E4A2.5DDC38A9@smartt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: drfrog@smartt.com, pgsqluser@yahoo.com
  Subject: Re: How do I use text script containing SQL?
  In-Reply-To: <3AA3E4A2.5DDC38A9@smartt.com>
  References: <20010305185600.44574.qmail@web12702.mail.yahoo.com> <3AA3E4A2.5DDC38A9@smartt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox