Re: Alternative to \copy in psql modelled after \g
Daniel Verite <daniel@manitou-mail.org>
From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
Cc: "Alvaro Herrera" <alvherre@2ndquadrant.com>,"Fabien COELHO"
<coelho@cri.ensmp.fr>,"PostgreSQL Hackers"
<pgsql-hackers@lists.postgresql.org>,"David G. Johnston"
<david.g.johnston@gmail.com>
Date: 2019-01-18T21:31:30Z
Lists: pgsql-hackers
Attachments
- psql-copyout-g-v2.patch (text/plain) patch v2
Tom Lane wrote: > I took a quick look at this patch. PFA an updated patch addressing your comments and Fabien's. I've also changed handleCopyOut() to return success if it could pump the data without writing it out locally for lack of an output stream. It seems to make more sense like that. While adding the note to the doc I've noticed that the other \copy tip says: "This operation is not as efficient as the SQL COPY command because all data must pass through the client/server connection. For large amounts of data the SQL command might be preferable. It doesn't specify that it's for COPY TO/FROM file, not COPY TO STDOUT/FROM STDIN. Of course the latter would rank the same as \copy with respect to client/server throughput. Should this tip be more specific? Best regards, -- Daniel Vérité PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite
Commits
-
Fix psql's "\g target" meta-command to work with COPY TO STDOUT.
- cda1e27fb706 9.5.16 landed
- ae4c7d5ab886 9.6.12 landed
- 8e97a97b3206 10.7 landed
- 6d3ede5f1c65 12.0 landed
- 2c50c9f23d1d 11.2 landed