Re: [PATCH v4] Add \warn to psql - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH v4] Add \warn to psql
Date
Msg-id 27942.1562344682@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH v4] Add \warn to psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH v4] Add \warn to psql  (David Fetter <david@fetter.org>)
List pgsql-hackers
I wrote:
> David Fetter <david@fetter.org> writes:
>> [ v7-0001-Add-warn-to-psql.patch ]

> I took a look at this.  I have no quibble with the proposed feature,
> and the implementation is certainly simple enough.  But I'm unconvinced
> about the proposed test scaffolding.

I pushed this with the simplified test methodology.

While I was fooling with it I noticed that the existing code for -n
is buggy.  The documentation says clearly that only the first
argument is a candidate to be -n:

        If the first argument is an unquoted <literal>-n</literal> the trailing
        newline is not written.

but the actual implementation allows any argument to be recognized as
-n:

regression=# \echo this -n should not be -n like this
this should not be like thisregression=#

I fixed that, but I'm wondering if we should back-patch that fix
or leave the back branches alone.

            regards, tom lane



pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: SHOW CREATE
Next
From: Raúl Marín Rodríguez
Date:
Subject: Re: Fix runtime errors from -fsanitize=undefined