piping output to file
Is there an easy way to pipe a select statement's output to a file?
--
[ Russ Schneider (a.k.a. Sugapablo) ]
[ http://www.sugapablo.com <--music ]
[ http://www.sugapablo.net <--personal ]
[ sugapablo@12jabber.com <--jabber IM ]
On Sun, Feb 08, 2004 at 12:28:21PM -0500, Russ Schneider wrote:
Is there an easy way to pipe a select statement's output to a file?
In psql, type \? and look at what \o and \g do. They both do it but slightly
differently.
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
Show quoted text
(... have gone from d-i being barely usable even by its developers
anywhere, to being about 20% done. Sweet. And the last 80% usually takes
20% of the time, too, right?) -- Anthony Towns, debian-devel-announce
That would depend on the client you're using. psql can do it either
directly (using \o) or by piping its output: psql -c "select * from
mytable;" mydb > out.txt
If you're using a programming library, I think you're on your own.
Adam Ruth
On Feb 8, 2004, at 10:28 AM, Russ Schneider wrote:
Show quoted text
Is there an easy way to pipe a select statement's output to a file?
--
[ Russ Schneider (a.k.a. Sugapablo) ]
[ http://www.sugapablo.com <--music ]
[ http://www.sugapablo.net <--personal ]
[ sugapablo@12jabber.com <--jabber IM ]---------------------------(end of
broadcast)---------------------------
TIP 6: Have you searched our list archives?
On Sun, 8 Feb 2004, Russ Schneider wrote:
Is there an easy way to pipe a select statement's output to a file?
In psql you can use \o [filename] to direct query output to a file.
also,
$ psql -c "select whatever_you_want from table_name" > outfile
reid
Show quoted text
-----Original Message-----
From: scott.marlowe [mailto:scott.marlowe@ihs.com]
Sent: Monday, February 09, 2004 12:17 PM
To: Russ Schneider
Cc: pgsql-general
Subject: Re: [GENERAL] piping output to fileOn Sun, 8 Feb 2004, Russ Schneider wrote:
Is there an easy way to pipe a select statement's output to a file?
In psql you can use \o [filename] to direct query output to a file.
---------------------------(end of
broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)
Import Notes
Resolved by subject fallback