Re: Improvements in psql hooks for variables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Rahila Syed <rahilasyed90(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improvements in psql hooks for variables
Date: 2017-01-30 18:17:42
Message-ID: 19940.1485800262@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-01-30 18:34:05 Re: Patch: Write Amplification Reduction Method (WARM)
Previous Message Nikita Glukhov 2017-01-30 18:12:31 Re: [PATCH]: fix bug in SP-GiST box_ops