[PATCH v4] Add \warn to psql

Поиск
Список
Период
Сортировка
От David Fetter
Тема [PATCH v4] Add \warn to psql
Дата
Msg-id 20190428145813.GO28936@fetter.org
обсуждение исходный текст
Ответ на Re: [PATCH v1] Add \echo_stderr to psql  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: [PATCH v4] Add \warn to psql  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
On Sat, Apr 27, 2019 at 10:09:27PM +0200, Fabien COELHO wrote:
> 
> 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)

My mistake. I didn't think the order in which they were compared
mattered much, but it makes sense on further reflection to keep things
tidy in the code.

> > > 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.

Here's the alphabetical version.

> > > > 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.

Speaking of which, I'd like to see about getting your patch against
Testlib.pm in so more tests of psql can also go in. It's not a new
feature /per se/, and it doesn't break any current scripts, so I'd
make the argument that it's OK for them to go in and possibly even be
back-patched.

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: clean up docs for v12
Следующее
От: David Fetter
Дата:
Сообщение: [PATCH v1] Add a way to supply stdin to TAP tests