Skip site navigation (1) Skip section navigation (2)

Re: SELECT to an external file

From: Devrim GUNDUZ <devrim(at)gunduz(dot)org>
To: Mário Gamito <gamito(at)netual(dot)pt>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT to an external file
Date: 2004-08-24 17:12:39
Message-ID: Pine.LNX.4.44.0408242010540.3666-100000@emo.org.tr (view raw or flat)
Thread:
Lists: pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

On Tue, 24 Aug 2004, [ISO-8859-1] Mário Gamito wrote:

> How can i draw the results of a SELECT in to a file in the filesystem ?

Use \o:

test=# \o testfile
test=# SELECT * from mytable;
test=#

All the output is redirected to testfile.

Regards,
- -- 
Devrim GUNDUZ	       
devrim~gunduz.org				devrim.gunduz~linux.org.tr 
			http://www.tdmsoft.com
			http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBK3cJtl86P3SPfQ4RAqXlAJ4rpEmebsqRM5f6eWLX6DKMdlFZ8QCgvzHk
bSMZ2kr9s9brM6U6Bn27jJs=
=CREY
-----END PGP SIGNATURE-----


In response to

pgsql-general by date

Next:From: Oliver ElphickDate: 2004-08-24 17:13:59
Subject: Re: SELECT to an external file
Previous:From: Oliver ElphickDate: 2004-08-24 17:12:12
Subject: Re: [GENERAL] Dump and Restore

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group