COPY (query) TO file - Mailing list pgsql-hackers

From Mark Woodward
Subject COPY (query) TO file
Date
Msg-id 17970.24.91.171.78.1149255589.squirrel@mail.mohawksoft.com
Whole thread Raw
Responses Re: COPY (query) TO file  (Tino Wildenhain <tino@wildenhain.de>)
Re: COPY (query) TO file  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Tom had posted a question about file compression with copy. I thought
about it, and I want to through this out and see if anyone things it is a
good idea.

Currently, the COPY command only copies a table, what if it could operate
with a query, as:

COPY (select * from mytable where foo='bar') as BAR TO stdout

I have no idea if it is doable, but I can see uses for replication

psql -h source mydb -c "COPY (select * from mytable where ID > xxxxx) as
mytable TO STDOUT" | psql -h target mydb -c "COPY mytable FROM stdin"




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Going for "all green" buildfarm results
Next
From: Tom Lane
Date:
Subject: Re: 'CVS-Unknown' buildfarm failures?