Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWQLe-00077G-Im for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jan 2018 17:27:34 +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 1eWQLd-0000M4-Pi for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jan 2018 17:27:33 +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 1eWQAC-0005Qn-JB for pgsql-bugs@lists.postgresql.org; Tue, 02 Jan 2018 17:15:44 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eWQA7-0005un-4e for pgsql-bugs@postgresql.org; Tue, 02 Jan 2018 17:15:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 583C920B8C; Tue, 2 Jan 2018 12:15:36 -0500 (EST) Received: from web1 ([10.202.2.211]) by compute6.internal (MEProxy); Tue, 02 Jan 2018 12:15:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=z0gf3VM8uw/orfJ7QyyETUjBaaovL Y2dVXW+Kzw8Pug=; b=B07Nzaqgy8btys68md2qLMcV5GklzkTvUNBglZ6PYsCvN wREsQYqrAb56mlZwU7z9uQbtiP2/kDYG0DctSFkK1ib3jW8fK1/6aWa7zUaTj5J5 JL80ErRhufn7lMdmrnz9BU/bEPzc3njnXfvRlUp5TPhnwp7yHYv2BqfquhZ5r6gJ DzMyhTGea7vGkHjGUI8fCD5A+fcJk7Ow9KcK4HovuXrdMrJ8+kP4Y2J0xRlzlWUV oV4CM0UAD/Zg9I938LLh8rPR9mkLTUip0k834h42LkNkkihukx0b46CN6qEbBbny MMHOnp71Nj34FmCVnQ3CfIaR2ydGLx74xZnOfSQog== X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 3F1C994208; Tue, 2 Jan 2018 12:15:36 -0500 (EST) Message-Id: <1514913336.4126920.1221903080.68C88494@webmail.messagingengine.com> From: Alan Robertson To: David Fetter Cc: "David G. Johnston" , Amit Kapila , Tom Lane , Postgres Bug MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-cc9a457c Date: Tue, 02 Jan 2018 10:15:36 -0700 Subject: Re: ALTER SYSTEM for tcp_keepalives_idle doesn't show up with the SHOW command. 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 > ); For my purposes, the query below may be slightly better - it doesn't provide unneeded information, and it avoids duplicate column names in the result: SELECT f.seqno, f.name, f.setting, f.applied, f.error FROM pg_settings s JOIN pg_file_settings f ON ( s.name = 'config_file' AND s.setting <> f.sourcefile ) ORDER by f.seqno; seqno | name | setting | applied | error -------+---------------------+---------+---------+------- 23 | tcp_keepalives_idle | 60 | t | (1 row) Thanks to everyone for the great product and the kind and gentle education! > > Best, > David. > P.S. In future, please don't top post. Had to switch which email address I was sending from to do that. Sorry for the confusion :-(. > -- > David Fetter http://fetter.org/ > Phone: +1 415 235 3778 Many thanks for everyone's help! -- Alan