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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-general by date

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