Re: [PATCH v1] Add \echo_stderr to psql
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: David Fetter <david@fetter.org>
Cc: Corey Huinker <corey.huinker@gmail.com>,
PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2019-04-27T14:05:20Z
Lists: pgsql-hackers
Attachments
- psql-warn-2-tap.patch (text/x-diff) patch
Hello David, > Please find attached v2, name is now \warn. Patch applies cleanly, compiles, "make check ok", although there are no tests. Doc gen ok. Code is pretty straightforward. I'd put the commands in alphabetical order (echo, qecho, warn) instead of e/w/q in the condition. The -n trick does not appear in the help lines, ISTM that it could fit, so maybe it could be added, possibly something like: \echo [-n] [TEXT] write string to stdout, possibly without trailing newline and same for \warn and \qecho? > How might we test this portably? Hmmm... TAP tests are expected to be portable. Attached a simple POC, which could be extended to test many more things which are currently out of coverage (src/bin/psql stuff is covered around 40% only). -- Fabien.
Commits
-
Add \warn command to psql.
- 02e95a5049f7 13.0 landed