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

Re: COPY (query) TO file

From: PFC <lists(at)peufeu(dot)com>
To: "Greg Stark" <gsstark(at)mit(dot)edu>, "Tino Wildenhain" <tino(at)wildenhain(dot)de>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Mark Woodward" <pgsql(at)mohawksoft(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY (query) TO file
Date: 2006-06-03 08:16:33
Message-ID: op.taj89v15cigqcu@apollo13 (view raw, whole thread or download thread mbox)
Lists: 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  

	MySQL already does this :

	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.

In response to


pgsql-hackers by date

Next:From: Greg StarkDate: 2006-06-03 14:22:19
Subject: Re: COPY (query) TO file
Previous:From: PFCDate: 2006-06-03 08:06:03
Subject: Re: Generalized concept of modules

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