Received: from serv1.ilse.nl (serv1.ilse.nl [212.189.131.11]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f25MEIx51057 for ; Mon, 5 Mar 2001 17:14:18 -0500 (EST) (envelope-from mathijs@serv0.ilse.nl) Received: from serv0.ilse.nl (serv0.ilse.nl [212.189.131.10]) by serv1.ilse.nl (8.11.0/8.10.2) with ESMTP id f25MEFE36659; Mon, 5 Mar 2001 23:14:15 +0100 (MET) Received: (from mathijs@localhost) by serv0.ilse.nl (8.11.1/8.11.1) id f25MEEQ23917; Mon, 5 Mar 2001 23:14:14 +0100 (CET) (envelope-from mathijs) Date: Mon, 5 Mar 2001 23:14:13 +0100 From: Mathijs Brands To: David Olbersen Cc: "Jeff S." , pgsql-sql@postgresql.org Subject: Re: How do I use text script containing SQL? Message-ID: <20010305231413.C22983@ilse.nl> References: <20010305185600.44574.qmail@web12702.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from dave@slickness.org on Mon, Mar 05, 2001 at 11:08:40AM -0800 X-Unexpected-Header: The Spanish Inquisition X-Archive-Number: 200103/72 X-Sequence-Number: 1719 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 -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