Re: Alternative to \copy in psql modelled after \g
Daniel Verite <daniel@manitou-mail.org>
From: "Daniel Verite" <daniel@manitou-mail.org>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: "PostgreSQL Hackers" <pgsql-hackers@lists.postgresql.org>
Date: 2018-11-09T17:23:10Z
Lists: pgsql-hackers
David G. Johnston wrote: > POLA, for me at least, would be for \g [filename] to do exactly what > you are describing with the \copyto feature. I admit that if we could improve \g to handle COPY, it would be more elegant than the current proposal adding two meta-commands. But the copy-workflow and non-copy-workflow are different, and in order to know which one to start, \g would need to analyze the query to determine whether it's a COPY FROM, COPY TO or something else. psql parses queries syntactically, but not semantically AFAIK, and I suspect we don't want to start doing that, as it breaks a separation of concerns. 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