From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: Rahila Syed <rahilasyed90@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Improvements in psql hooks for variables
Date: Mon, 30 Jan 2017 13:17:42 -0500
Message-ID: <19940.1485800262@sss.pgh.pa.us> (raw)
In-Reply-To: <17593.1485798464@sss.pgh.pa.us>
References: <fa2685de-5262-460d-9eca-f027a5de0d7d@manitou-mail.org>
<11456.1485288184@sss.pgh.pa.us>
<CAH2L28uYE6mRr1rdjgL=MBH-xg1_-viBvjnKR7T59pwZuPFnsw@mail.gmail.com>
<CAH2L28ugrq+N_=i8f6RvWL0NPUhT84CAp8SrDg1RoSc0T7+qBg@mail.gmail.com>
<17593.1485798464@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, daniel@manitou-mail.org, rahilasyed90@gmail.com, sfrost@snowman.net, ashutosh.bapat@enterprisedb.com
Subject: Re: Improvements in psql hooks for variables
In-Reply-To: <19940.1485800262@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox