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

From Mark Woodward
Subject Re: COPY (query) TO file
Date
Msg-id 18278.24.91.171.78.1149256878.squirrel@mail.mohawksoft.com
Whole thread Raw
In response to Re: COPY (query) TO file  (Tino Wildenhain <tino@wildenhain.de>)
Responses Re: COPY (query) TO file  (Tino Wildenhain <tino@wildenhain.de>)
List pgsql-hackers
> Mark Woodward wrote:
>> 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
>
> I doubt it be really usefull (apart from maybe saving some work
> coding a client app) but did you actually test it with
>
> create table as select ...; followed by a copy of that table
> if it really is faster then just the usual select & fetch?

Why "create table?"

The idea is that you would have one or more redundent databases and use
the COPY TO/FROM to keep them up to date.


pgsql-hackers by date:

Previous
From: Tino Wildenhain
Date:
Subject: Re: COPY (query) TO file
Next
From: Andrew Dunstan
Date:
Subject: Re: COPY (query) TO file