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

Re: [HACKERS] Performance testing of COPY (SELECT) TO

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Performance testing of COPY (SELECT) TO
Date: 2006-08-28 03:42:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Removed Cc: to pgsql-hackers.


Zoltan Boszormenyi wrote:

> >Your patch has been added to the PostgreSQL unapplied patches list at:
> >
> >
> >
> >It will be applied as soon as one of the PostgreSQL committers reviews
> >and approves it.
> Thanks. Would you please add this instead?
> psql built-in \copy (select ...) now also work.

Please check this one out.  I took the version you posted here and
changed the stuff in the parser that I didn't like, and removed the ugly
"SELECT * FROM" stuff that was bothering me.  I also removed the
transformCopyStmt stuff as it seems unnecessary to me.  I did all that
stuff in a cleaner way (IMO).

I also cleaned up the grammar -- basically added a separate case from
the regular COPY.  I took the opportunity to remove the
backwards-compatible options from there.  I didn't check that stuff very
much but it should continue to work ...

I noticed that this works:

alvherre=# copy (values (1, 'uno'), (2, 'dos'), (3, 'tr;es'), (4, NULL)) to stdout with delimiter ';' null 'NUL' csv quote as '"';

which is nice.

With this patch, the COPY view FROM stdout path now throws an error --
in your version it worked (because of that "COPY * FROM" stuff), and
from previous discussion it seems reasonable to behave differently for
views than for plain tables (i.e. it's reasonable that we fail for
I also broke the check for a FOR UPDATE clause.  Not sure where but it
must be easy to fix :-)  I'd do it myself but I'm heading to bed right

I also wanted to check these hunks in your patch, which I didn't like
very much:

-ERROR:  column "a" of relation "test" does not exist
+ERROR:  column "a" does not exist

but didn't got around to it.

I also noticed that the new copyselect regression test is not added to
the serial schedule.

I'll repost a reworked version at some point, if no one beats me to it.

Alvaro Herrera                      
The PostgreSQL Company - Command Prompt, Inc.

In response to


pgsql-hackers by date

Next:From: Joshua D. DrakeDate: 2006-08-28 03:49:21
Subject: Re: is up
Previous:From: Tom LaneDate: 2006-08-28 03:33:52
Subject: Re: [PATCHES] Another VPATH patch for ecpg

pgsql-patches by date

Next:From: Tom LaneDate: 2006-08-28 03:53:20
Subject: Re: [HACKERS] Performance testing of COPY (SELECT) TO
Previous:From: Tom LaneDate: 2006-08-28 03:33:52
Subject: Re: [PATCHES] Another VPATH patch for ecpg

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