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

From Mathijs Brands
Subject Re: How do I use text script containing SQL?
Date
Msg-id 20010305231413.C22983@ilse.nl
Whole thread Raw
In response to Re: How do I use text script containing SQL?  (David Olbersen <dave@slickness.org>)
List pgsql-sql
On Mon, Mar 05, 2001 at 11:08:40AM -0800, David Olbersen allegedly wrote:
> On Mon, 5 Mar 2001, Jeff S. wrote:
> 
> ->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.
> 
> You're making it too dificult :-)
> 'psql -d databasename < filename.txt' should work just fine

Strange, the syntax you used (psql -d <dbname> -e) should work...

serv0:~$ echo '\d ntree' | psql -d iig -e        Table "ntree"Attribute |  Type   | Modifier
-----------+---------+----------pid       | integer |cid       | integer |
Indices: idx_ntree_cid,        idx_ntree_pid

I'm using psql 7.0.3 and I'm pretty sure it also works for 6.5.x.

Mathijs
-- 
It's not that perl programmers are idiots, it's that the language
rewards idiotic behavior in a way that no other language or tool has
ever done.                                                   Erik Naggum


pgsql-sql by date:

Previous
From: Justin Long
Date:
Subject: Re: Optimizing Query
Next
From: Justin Long
Date:
Subject: Re: Optimizing Query