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: "Fabien COELHO" <coelho@cri.ensmp.fr>,"Alvaro Herrera" <alvherre@2ndquadrant.com>,"PostgreSQL Hackers" <pgsql-hackers@lists.postgresql.org>,"David G. Johnston" <david.g.johnston@gmail.com>
Date: 2019-01-28T16:01:40Z
Lists: pgsql-hackers
	Tom Lane wrote:

> > Now as far as I can see, there is nothing that \copy to file or program
> > can do that COPY TO STDOUT cannot do.
> 
> I don't think there's a way to get the effect of "\copy to pstdout"
> (which, IIRC without any caffeine, means write to psql's stdout regardless
> of where queryFout is currently pointing).

\g /dev/stdout would work already on systems like Linux that provide
this alias.
Otherwise "\g -" looks good as a portable solution.

Best regards,
-- 
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


Commits

  1. Fix psql's "\g target" meta-command to work with COPY TO STDOUT.