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

From Tino Wildenhain
Subject Re: COPY (query) TO file
Date
Msg-id 4480AC06.5030103@wildenhain.de
Whole thread Raw
In response to Re: COPY (query) TO file  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: COPY (query) TO file  (Greg Stark <gsstark@mit.edu>)
Re: COPY (query) TO file  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Tino Wildenhain <tino@wildenhain.de> writes:
>> Ok, but why not just implement this into pg_dump or psql?
>> Why bother the backend with that functionality?
> 
> You're not seriously suggesting we reimplement evaluation of WHERE clauses
> on the client side, are you?

no, did I? But what is wrong with something like:

\COPY 'SELECT foo,bar,baz FROM footable WHERE baz=5 ORDER BY foo' TO
file|stdout

which would just run the query (in the backend of course) and
format the output just like copy would...

I mean, ok, when its in the backend, its fine too (beside the
data expansion if you dont implement compression...)
but I thougt implementing in the frontend would be easier...

Regards
Tino


pgsql-hackers by date:

Previous
From: "Mark Woodward"
Date:
Subject: Re: COPY (query) TO file
Next
From: Jim Nasby
Date:
Subject: bgwriter statistics