Re: Dump and Query (fwd)

From: "Ben K(dot)" <bkim(at)coe(dot)tamu(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Dump and Query (fwd)
Date: 2007-01-04 23:31:10
Message-ID: Pine.GSO.4.64.0701041721100.21599@coe.tamu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


> Is there any way to make a dump from a query?
> select field1,field2 from table
> Does it exist a shell command like pg_dump --QUERY myquery -f myfile?

Belated, but it looks this is another way (equivalent to Andy Shellam's)

cat >> query.txt
select field1,field2 from table
^D

1. psql $database > dumpfile < query.txt

or

2. Same, on the fly

psql $database > dumpfile <<_eof_
select field1,field2 from table
_eof_

Regards,

Ben K.
Developer
http://benix.tamu.edu

Browse pgsql-admin by date

  From Date Subject
Next Message Ming 2007-01-05 01:15:13 Re: Autovacuum not running in 8.2.0
Previous Message Andy Shellam (Mailing Lists) 2007-01-04 18:37:48 Re: Windows Dependency Issue