Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lpyVQ-00057H-K8 for pgsql-general@arkaria.postgresql.org; Sun, 06 Jun 2021 19:32:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lpyVP-00076b-F5 for pgsql-general@arkaria.postgresql.org; Sun, 06 Jun 2021 19:32:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lpyVN-00076S-VR for pgsql-general@lists.postgresql.org; Sun, 06 Jun 2021 19:32:19 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lpyVL-0006Hi-6M for pgsql-general@postgresql.org; Sun, 06 Jun 2021 19:32:16 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C4C445C0078; Sun, 6 Jun 2021 15:32:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 06 Jun 2021 15:32:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=A NDr7bTVpM3G59o6S2WrOCpQ6rdO7OsjjqUBvtuni3w=; b=KYTmP3DQ+O6V1IdmB UKllYsgZpiicG8YIQb7SD4+RENrHDN/OEYNUDUhYfbi+aeJbjKCQ8TY4IRyvMNQH Uudbk7XKOzKUh8cuwJYHCxQSal5muuudIiIBERVU0nOnv3DQVRWD0vgO1tKEUB4M ejDyfLBFJN6p8CQK5lbLuZxJB6tJ24QhtO5Hh8A7lGtaP7SYZ2c8m0x2o+CVBYT9 X9Ei9PKSi4EB+OzH934JUg5lqRDD6P98bm59XC9NbngtIcTAMBg1tmU5hYcIf0cR 9P+1Sp6QPVfhQH3ifKudEBhHtaCjGTbCLBcfF9pd38doKCsBUzoRuWJrS5bPUGbw CxPaQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=ANDr7bTVpM3G59o6S2WrOCpQ6rdO7OsjjqUBvtuni 3w=; b=LtGmlyAuf3RBoL4r2yZBhL9+YD+KeBzaPwr9FgfDIYCwdOGgJVve4XVQS K4aEqmSUj6LaWDxdBcnMPkDuqN9gdr2dToHI4Cf75DEEIpqFnNGdo2nBi/HFvJsf QT2IKPODQ3nRIHhiSGQXmFqwdbysCb91vHoKbWTRSeXxi8xcL2DSfuGKig6JWl8D ktrTAudGNk8vT3vqqvJD7AElsQKv00pCQmlOf8ckKGaLOxUDv5jEpeD6637vup0C 4edaCYNJd9QbJ2sYdsDyIhv2ll1r0iGKsxwn/7snEJin1D19lUWVv+3fX9gdjz+V bbZ3p12oOvn7h1aAlyMg6pZBjTHXw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedthedgudegtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeduudefje etveffhefgudehtdfhvdetkeeiueehfeevveduteekleeuheegudehhfenucffohhmrghi nhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdr tghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 6 Jun 2021 15:32:13 -0400 (EDT) Subject: Re: Symbolic link breaks for postgresql.auto.conf To: Vijaykumar Jain References: <651677.1622998017@sss.pgh.pa.us> <62388a6b-3d5e-011e-5549-ba0f3b505b3e@aklaver.com> Cc: pgsql-general From: Adrian Klaver Message-ID: Date: Sun, 6 Jun 2021 12:32:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/6/21 10:50 AM, Vijaykumar Jain wrote: Please reply to list also. Ccing list Also please use inline or bottom posting, it makes things easier to follow. > Yeah I am aware of that :) > > I was referring to if the main config is managed via some config > management tool like puppet, ansible or  anything else that would wipe > the changes made temporarily. Which 'includes' could handle depending on what the config management tool is using as the starting main config(postgresql.conf I presume). If that file is seeded with an include, or better yet include_if_exists, that point at files outside PG_DATA then you would have the ability to override settings at will with a reload/restart. If the above does not cover your use case you will need to provide a more detailed description of how your configuration management is done. > > > On Sun, Jun 6, 2021, 10:45 PM Adrian Klaver > wrote: > > On 6/6/21 10:02 AM, Vijaykumar Jain wrote: > > Yes, I learnt it the hard way as well :) I made changes via the > alter > > system, and did a pg_restore, and the changes were lost  :) > > > > use the alter system for ad hoc changes, but make sure those > changes are > > added back to the postgresql.conf file immediately (or however > the main > > conf file is managed). > > I would suggest taking a look at 'includes': > > https://www.postgresql.org/docs/13/config-setting.html#CONFIG-INCLUDES > > > > > > > > > On Sun, 6 Jun 2021 at 22:17, Tom Lane > > >> wrote: > > > >     RAJAMOHAN >> writes: > >      > I am trying to keep a symbolic link for the > >     *postgresql.auto.conf* outside > >      > the data directory. The link gets created but whenever I > issue an > >     alter > >      > system statement it gets broken. > > > >     This is not supported.  Don't do it. > > > >     The right way to keep the hand-maintained config files > outside the > >     data directory is not the way you've done it here, either. > It might > >     accidentally work, but the preferred way is to put > "data_directory = > >     whatever" in postgresql.conf and then start the postmaster > with -D > >     pointing at where the config files are. > > > >     But in any case, postgresql.auto.conf is not hand-maintained; it > >     is part of the cluster data, so it belongs in the data directory. > > > >                              regards, tom lane > > > > > > > > > > -- > > Thanks, > > Vijay > > Mumbai, India > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com