Re: [PATCH v1] Add \echo_stderr to psql - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [PATCH v1] Add \echo_stderr to psql
Date
Msg-id alpine.DEB.2.21.1904272158120.29865@lancre
Whole thread Raw
In response to Re: [PATCH v1] Add \echo_stderr to psql  (David Fetter <david@fetter.org>)
Responses [PATCH v4] Add \warn to psql
List pgsql-hackers
Hello David,

About v3. Applies, compiles, global & local make check are ok. doc gen ok.

>> I'd put the commands in alphabetical order (echo, qecho, warn) instead of
>> e/w/q in the condition.
>
> Done.

Cannot see it:

   + else if (strcmp(cmd, "echo") == 0 || strcmp(cmd, "warn") == 0 || strcmp(cmd, "qecho") == 0)

>> 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?
>
> Makes sense, but I put it there just for \echo to keep lines short.

I think that putting together the 3 echo variants help makes sense, but 
maybe someone will object about breaking the abc order.

>>> 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).
>
> Thanks for putting this together. I've added this test, and agree that
> increasing coverage is important for another patch.

Yep.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Failure in contrib test _int on loach
Next
From: Fabien COELHO
Date:
Subject: Re: nRe: [PATCH v1] Show whether tables are logged in \dt+