Re: [HACKERS] Performance testing of COPY (SELECT) TO
От | Alvaro Herrera |
---|---|
Тема | Re: [HACKERS] Performance testing of COPY (SELECT) TO |
Дата | |
Msg-id | 20060828034211.GA24259@alvh.no-ip.org обсуждение исходный текст |
Ответ на | Re: [HACKERS] Performance testing of COPY (SELECT) TO (Zoltan Boszormenyi <zboszor@dunaweb.hu>) |
Ответы |
Re: [HACKERS] Performance testing of COPY (SELECT) TO
|
Список | pgsql-patches |
Removed Cc: to pgsql-hackers. Zoltán, Zoltan Boszormenyi wrote: > >Your patch has been added to the PostgreSQL unapplied patches list at: > > > > http://momjian.postgresql.org/cgi-bin/pgpatches > > > >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 quoteas '"'; 1;uno 2;dos 3;"tr;es" 4;NUL 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 views). 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 now. 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 http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
Вложения
В списке pgsql-patches по дате отправления: