Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWPK7-0003TC-TJ for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jan 2018 16:21:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWPK7-0002mi-5n for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jan 2018 16:21:55 +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 1eWPK7-0002mY-03 for pgsql-bugs@lists.postgresql.org; Tue, 02 Jan 2018 16:21:55 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eWPK3-0004hY-0z for pgsql-bugs@postgresql.org; Tue, 02 Jan 2018 16:21:54 +0000 Received: by fetter.org (Postfix, from userid 1001) id 5FF204197C; Tue, 2 Jan 2018 17:21:49 +0100 (CET) Date: Tue, 2 Jan 2018 17:21:49 +0100 From: David Fetter To: "Robertson, Alan L" Cc: "David G. Johnston" , Amit Kapila , Tom Lane , Postgres Bug Subject: Re: ALTER SYSTEM for tcp_keepalives_idle doesn't show up with the SHOW command. Message-ID: <20180102162149.GA18841@fetter.org> References: <1513959489455.36489@charter.com> <17247.1513963209@sss.pgh.pa.us> <1513964805505.77792@charter.com> <20171227160545.GC32234@fetter.org> <20171227161916.GD32234@fetter.org> <1514908514385.76652@charter.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1514908514385.76652@charter.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Jan 02, 2018 at 03:55:14PM +0000, Robertson, Alan L wrote: > > This query seems to be pretty cool for looking at configuration changes: > > SELECT pg_settings.setting INTO TEMPORARY config_file FROM pg_settings WHERE name = 'config_file'; > SELECT * FROM config_file INNER JOIN pg_file_settings ON config_file.setting!=pg_file_settings.sourcefile; > > The intent of this query is to return the values of all settings which have been modified by SQL from the installation defaults. > > I'm an SQL newbie, so I'm sure this august body can improve it. But it does appear to work ;-) It does indeed. > The output of the join looks something like this - and it has the _correct_ version of the TCP variables, even when run locally. > > > setting | sourcefile | sourceline | seqno | name | setting | applied | error > ------------------------------------------+---------------------------------------------------+------------+-------+---------------------+---------+---------+------- > /etc/postgresql/9.5/main/postgresql.conf | /var/lib/postgresql/9.5/main/postgresql.auto.conf | 3 | 23 | tcp_keepalives_idle | 60 | t | > (1 row) You don't actually need to create a temporary table to get that. You could use something like: SELECT s.setting, f.* FROM pg_settings s JOIN pg_file_settings f ON ( s.name = 'config_file' AND s.setting <> f.sourcefile ); Best, David. P.S. In future, please don't top post. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate