From: Bricklen Anderson <banderson@presinet.com>
To: Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
Cc: pgsql-admin@postgresql.org
Subject: Re: Dump and Query
Date: Wed, 27 Dec 2006 08:17:12 -0800
Message-ID: <45929C88.6000808@presinet.com> (raw)
In-Reply-To: <459263C1.2040401@mailnetwork.co.uk>
References: <20061227140530.094fc4d3.scotty@linuxtime.it>
<459263C1.2040401@mailnetwork.co.uk>
Andy Shellam (Mailing Lists) wrote:
> Hi Enrico,
>
> The following command will get you a text file of your result-set:
>
> # echo "SELECT customer_id, first_name, sur_name FROM
> users;"|/usr/local/pgsql/bin/psql -U [username] -d [database] > myfile.txt
> # cat myfile.txt
Alternative version:
psql -d <your dbname> -c "SELECT customer_id, first_name, sur_name FROM
users" -o myfile.txt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: banderson@presinet.com, andy.shellam-lists@mailnetwork.co.uk
Subject: Re: Dump and Query
In-Reply-To: <45929C88.6000808@presinet.com>
References: <20061227140530.094fc4d3.scotty@linuxtime.it> <459263C1.2040401@mailnetwork.co.uk> <45929C88.6000808@presinet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox