Skip site navigation (1) Skip section navigation (2)

Re: COPY (query) TO file

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Mark Woodward <pgsql(at)mohawksoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY (query) TO file
Date: 2006-06-02 13:41:48
Message-ID: 4480401C.7080308@wildenhain.de (view raw or flat)
Thread:
Lists: 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?

Regards
Tino

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2006-06-02 13:56:07
Subject: Re: COPY (query) TO file
Previous:From: Larry RosenmanDate: 2006-06-02 13:40:49
Subject: Re: Going for 'all green' buildfarm results

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group