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

From PFC
Subject Re: COPY (query) TO file
Date
Msg-id op.taj89v15cigqcu@apollo13
Whole thread Raw
In response to Re: COPY (query) TO file  (Greg Stark <gsstark@mit.edu>)
Responses Re: COPY (query) TO file  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
> I was also vaguely pondering whether all the DDL commands could be  
> generalized
> to receive or send COPY formatted data for repeated execution. It would  
> be
> neat to be able to prepare an UPDATE with placeholders and stream data  
> in COPY
> format as parameters to the UPDATE to execute it thousands or millions of
> times without any protocol overhead or network pipeline stalls.

MySQL already does this for INSERT :INSERT INTO x (a,b) VALUES (1,2), (3,4), (5,6)...;

> allowing arbitrary SELECT statements as a COPY source
> seems much more powerful and flexible than just supporting COPY FROM  
> VIEW.
MySQL already does this :SELECT INTO OUTFILE blah FROM table...
Now in both cases the MySQL syntax sucks but it's still quite practical,  
and the INSERT saves some overhead (parsing, acquiring locks...) and is  
quite a bit faster than regular INSERT.


pgsql-hackers by date:

Previous
From: PFC
Date:
Subject: Re: Generalized concept of modules
Next
From: Greg Stark
Date:
Subject: Re: COPY (query) TO file