Re: COPY (query) TO file

From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Mark Woodward <pgsql(at)mohawksoft(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY (query) TO file
Date: 2006-06-02 14:23:41
Message-ID: 448049ED.5090908@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan wrote:
> 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
>>
>>
>
>
> Isn't this already being worked on? The TODO list says:
>
> Allow COPY to output from views
> Another idea would be to allow actual SELECT statements in a COPY.
>
> Personally I strongly favor the second option as being more flexible
> than the first.

I second that - allowing arbitrary SELECT statements as a COPY source
seems much more powerful and flexible than just supporting COPY FROM VIEW.

Stefan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-06-02 14:29:42 Re: 'CVS-Unknown' buildfarm failures?
Previous Message Mark Woodward 2006-06-02 14:23:30 Re: COPY (query) TO file