Re: Dump and Query (fwd) - Mailing list pgsql-admin

From Ben K.
Subject Re: Dump and Query (fwd)
Date
Msg-id Pine.GSO.4.64.0701041721100.21599@coe.tamu.edu
Whole thread Raw
List 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


pgsql-admin by date:

Previous
From: "Andy Shellam (Mailing Lists)"
Date:
Subject: Re: Windows Dependency Issue
Next
From: Ming
Date:
Subject: Re: Autovacuum not running in 8.2.0