Re: Improvements in psql hooks for variables

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rahila Syed <rahilasyed90(at)gmail(dot)com>, 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: 2016-11-21 13:41:35
Message-ID: 20161121134135.GF13284@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel,

* Daniel Verite (daniel(at)manitou-mail(dot)org) wrote:
> Tom Lane wrote:
>
> > Stephen Frost <sfrost(at)snowman(dot)net> writes:
> > > In reviewing this patch, I also noticed that it's set up to assume a
> > > 'true' result when a variable can't be parsed by ParseVariableBool.
> >
> > I suppose that's meant to be backwards-compatible with the current
> > behavior:
> >
> > regression=# \timing foo
> > unrecognized value "foo" for "\timing"; assuming "on"
> > Timing is on.
>
> Exactly. The scope of the patch is limited to the effect
> of \set assignments to built-in variables.
>
> > but I agree that if we're changing things in this area, that would
> > be high on my list of things to change. I think what we want going
> > forward is to disallow setting "special" variables to invalid values,
> > and that should hold both for regular variables that have special
> > behaviors, and for the special-syntax cases like \timing.
>
> +1

Not sure I follow your reply here. There seems to be broad agreement to
improve how we handle both \set and "special" variables and the code
paths are related and this patch is touching them, so it seems like the
correct next step here is to adjust the patch to update the code based
on that agreement.

Are you working to make those changes? I'd rather we make the changes
to this code once rather than push what you have now only to turn around
and change it significantly again.

Thanks!

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Verite 2016-11-21 13:44:37 Re: Improvements in psql hooks for variables
Previous Message Daniel Verite 2016-11-21 13:29:57 Re: Improvements in psql hooks for variables