Re: Alternative to \copy in psql modelled after \g

Daniel Verite <daniel@manitou-mail.org>

From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Fabien COELHO" <coelho@cri.ensmp.fr>
Cc: "PostgreSQL Hackers" <pgsql-hackers@lists.postgresql.org>,"David G. Johnston" <david.g.johnston@gmail.com>
Date: 2018-12-27T17:43:42Z
Lists: pgsql-hackers
	Fabien COELHO wrote:

> Dunno. Even if an additional tap test would not be backpatched, it could 
> be added on master. I'm basically sadden by pg test coverage, especially 
> psql which is under 40%, so I try to grasp any improvement opportunity…
> 
> See https://coverage.postgresql.org/

Maybe I misunderstand something, as I'm not familiar with TAP tests,
but hasn't psql no such test to begin with, as opposed to the
other programs in src/bin that have a t/ directory?

$ find . -name t
./pg_resetwal/t
./scripts/t
./pg_archivecleanup/t
./pg_verify_checksums/t
./pg_config/t
./pg_controldata/t
./pgbench/t
./pg_rewind/t
./pg_basebackup/t
./pg_dump/t
./initdb/t
./pg_ctl/t


In that case, the first thing we'd need is to add check and installcheck
targets in .../psql/Makefile, and a t/ directory with at least one Perl
script.
If that's the way to go forward, let's just do that in a patch
with a specific entry in the next CF like "Add TAP tests to psql".
Personally I'll be willing to submit and review new tests in t
independently of the patch discussed in $subject.


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.