Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYGXx-0006BE-26 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jan 2017 18:19:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cYGXw-0007Sv-0v for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jan 2017 18:19:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cYGWV-0004EP-E7 for pgsql-hackers@postgresql.org; Mon, 30 Jan 2017 18:17:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cYGWR-00078V-Hp for pgsql-hackers@postgresql.org; Mon, 30 Jan 2017 18:17:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v0UIHgtZ019941; Mon, 30 Jan 2017 13:17:42 -0500 From: Tom Lane To: Daniel Verite cc: Rahila Syed , Stephen Frost , Ashutosh Bapat , pgsql-hackers Subject: Re: Improvements in psql hooks for variables In-reply-to: <17593.1485798464@sss.pgh.pa.us> References: <11456.1485288184@sss.pgh.pa.us> <17593.1485798464@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 30 Jan 2017 12:47:44 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19939.1485800262.1@sss.pgh.pa.us> Date: Mon, 30 Jan 2017 13:17:42 -0500 Message-ID: <19940.1485800262@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) 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 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