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>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Subject: Re: Improvements in psql hooks for variables
Date: 2017-01-31 21:07:12
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I wrote:
> Attached is a draft patch for that. I chose to make a second hook rather
> than complicate the assign hook API, mainly because it allows more code
> sharing --- all the bool vars can share the same substitute hook, and
> so can the three-way vars as long as "on" and "off" are the appropriate
> substitutes.

> I only touched the behavior for bool vars here, but if people like this
> solution it could be fleshed out to apply to all the built-in variables.

Attached is a finished version that includes hooks for all the variables
for which they were clearly sensible. (FETCH_COUNT doesn't seem to really
need one, and I didn't do anything with HISTSIZE or IGNOREEOF either.
It might be worth bringing the latter two into the hooks paradigm, but
that seems like fit material for a separate patch.)

I updated the documentation as well. I think this is committable if
there are not objections.

regards, tom lane

Attachment Content-Type Size
improve-psql-bool-var-behavior-2.patch text/x-diff 42.2 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2017-01-31 21:20:49 Re: patch: function xmltable
Previous Message Craig Ringer 2017-01-31 20:42:50 Re: logical decoding of two-phase transactions