Re: [HACKERS] Improvements in psql hooks for variables - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Improvements in psql hooks for variables
Date
Msg-id 19940.1485800262@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Improvements in psql hooks for variables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
BTW, while testing this patch I noticed that the error reports are
a tad redundant:

regression=# \set AUTOCOMMIT foo
unrecognized value "foo" for "AUTOCOMMIT": boolean expected
\set: error while setting variable
regression=# 

The "error while setting variable" message seems entirely content-free.
I think we should drop that and instead establish a rule that SetVariable
should print a message for itself about any failure.  (There are a lot
of call sites that don't check for or print a message, but that's only
because they aren't expecting failure.  If one were to happen, printing
a message doesn't seem unreasonable.)  That would in turn propagate into
an API requirement that var hooks that return FALSE are responsible for
printing a message about the reason, which is why it would be appropriate
to make that change as part of this patch.

Barring objections PDQ, I'll make this change.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Nikita Glukhov
Date:
Subject: Re: [HACKERS] [PATCH]: fix bug in SP-GiST box_ops
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)