Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8otI-0008NC-Lz for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Nov 2016 13:44:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c8otH-0004uw-Qe for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Nov 2016 13:44:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c8ort-0003Ja-0q for pgsql-hackers@postgresql.org; Mon, 21 Nov 2016 13:42:45 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8orl-0005i2-5u for pgsql-hackers@postgresql.org; Mon, 21 Nov 2016 13:42:43 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id B462D5F7AE; Mon, 21 Nov 2016 08:41:35 -0500 (EST) Date: Mon, 21 Nov 2016 08:41:35 -0500 From: Stephen Frost To: Daniel Verite Cc: Tom Lane , Rahila Syed , Ashutosh Bapat , pgsql-hackers Subject: Re: Improvements in psql hooks for variables Message-ID: <20161121134135.GF13284@tamriel.snowman.net> References: <7464.1479599073@sss.pgh.pa.us> <4d4b8d34-6233-4fb4-93dc-7e929808b982@mm> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MRNWp8VlfMufsMVa" Content-Disposition: inline In-Reply-To: <4d4b8d34-6233-4fb4-93dc-7e929808b982@mm> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 08:38:48 up 135 days, 15:03, 25 users, load average: 0.72, 0.62, 0.50 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -4.9 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --MRNWp8VlfMufsMVa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Daniel, * Daniel Verite (daniel@manitou-mail.org) wrote: > Tom Lane wrote: >=20 > > Stephen Frost 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. > >=20 > > I suppose that's meant to be backwards-compatible with the current > > behavior: > >=20 > > regression=3D# \timing foo > > unrecognized value "foo" for "\timing"; assuming "on" > > Timing is on. >=20 > Exactly. The scope of the patch is limited to the effect > of \set assignments to built-in variables. >=20 > > 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. >=20 > +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 --MRNWp8VlfMufsMVa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYMvmPAAoJEO1sijiDR2RVBwUP/1liOq8T05c5whC+68Um7qQt jaLZ4MdRZuT8eBkMVqCBdvDIG4+zfI3kQV5l3PcQiwWgMA7HPve/7wgM8IbWMoUW 0e3JUsNx0bA8HIxAgPhDCNHW512F0IfLOK6bdB6TW4UoktE7thFTZwitGd/nTaVX h3ALoOIrvhoCETdTcKj5PU/qQ3ftwrWkF7Eq21fk0O89TKTZ9VwW8qLX0GbQwntd UMFMjQrJ8SRpJR5s31oTwVRyvmhcZ7+cio/uvrxuTA1TfS0vjkXHkBWcwWHEgndn VdJLe4hFG66v+OROfwSuRQiTKBG+2dqT5CzrWblYW1OBRc4mOx82Ue9OB9w+djsr hTz9Fb31HolYRf7O3N7ipqrTrhNbfQ1Dx4SLqKOL+TMQp/Wi2mPtGomCYjlJugyC nRSaXv1L8N4179af6LQsrrOQOIYQKF5q6NgW3+xY8/jSu5cTTr1vImhVzP6bleiv RyoecJJnZ0GRoZgdzdX6s/nWXt9LQMbc12lKHNZXe+udoeShm8UIHrD87U5d5/6A //8/UVUFsLq+CxUnzsvI6hz5+7QpwGmcKRVvIZQT5h2fTgl7NG95raMgqz42uNQd NTGsiKwTmdYfjj1Ssk/8eC+/YKb2Q5+4XkAWkhcc1VXBSUYUAZuJEZDD75UsirXc /3ILBI46jPkczkBHRN7W =2LLE -----END PGP SIGNATURE----- --MRNWp8VlfMufsMVa--