Re: Improvements in psql hooks for variables
Daniel Verite <daniel@manitou-mail.org>
From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
Cc: "Rahila Syed" <rahilasyed90@gmail.com>,"Stephen Frost"
<sfrost@snowman.net>,"Ashutosh Bapat"
<ashutosh.bapat@enterprisedb.com>,"pgsql-hackers"
<pgsql-hackers@postgresql.org>
Date: 2017-01-24T16:59:10Z
Lists: pgsql-hackers
Attachments
- psql-var-hooks-v7.patch (text/plain) patch v7
- (unnamed) (text/plain)
Tom Lane wrote: > I took a quick look through this. It seems to be going in generally > the right direction, but here's a couple of thoughts: Here's an update with these changes: per Tom's suggestions upthread: - change ParseVariableBool() signature to return validity as bool. - remove ParseCheckVariableNum() in favor of using tightened up ParseVariableNum() and GetVariableNum(). - updated header comments in variables.h other changes: - autocommit_hook rejects transitions from OFF to ON when inside a transaction, per suggestion of Rahila Syed (which was the original motivation for the set of changes of this patch). - slight doc update for HISTCONTROL (values outside of enum not longer allowed) - add enum-style suggestions on invalid input for \pset x, \pset pager, and \set of ECHO, ECHO_HIDDEN, ON_ERROR_ROLLBACK, COMP_KEYWORD_CASE, HISTCONTROL, VERBOSITY, SHOW_CONTEXT, \x, \pager Best regards, -- Daniel Vérité PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite
Commits
-
Clean up psql's behavior for a few more control variables.
- fd6cd698031d 10.0 landed
-
Make psql's \set display variables in alphabetical order.
- c3e3844a92fe 10.0 landed
-
Improve psql's behavior for \set and \unset of its control variables.
- 86322dc7e013 10.0 landed
-
Make psql reject attempts to set special variables to invalid values.
- 511ae628f31b 10.0 landed