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

From Greg Stark
Subject Re: COPY (query) TO file
Date
Msg-id 87r726co9w.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: COPY (query) TO file  (PFC <lists@peufeu.com>)
Responses Re: COPY (query) TO file  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: COPY (query) TO file  (PFC <lists@peufeu.com>)
List pgsql-hackers
PFC <lists@peufeu.com> writes:

> > 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)...;

Does MySQL really let you stream that? Trying to do syntax like that in
Postgres wouldn't work because the parser would try to build up a parse tree
for the whole statement before running the command.

-- 
greg



pgsql-hackers by date:

Previous
From: PFC
Date:
Subject: Re: COPY (query) TO file
Next
From: Tom Lane
Date:
Subject: Re: COPY (query) TO file