pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Vijaykumar Jain <vijaykumarjain.github@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Symbolic link breaks for postgresql.auto.conf
Date: Sun, 6 Jun 2021 12:32:12 -0700
Message-ID: <fb95d3b3-771d-82af-201d-254ad29b7699@aklaver.com> (raw)
In-Reply-To: <CAM+6J94LTTcb3htdyxHWJivs3uZ7CyEn6zD0rqG07EZEGRkUuQ@mail.gmail.com>
References: <CAFzdntuKqBv9wYcKVHutJSTypG12z+2dPJZd4d7hnTeyzcuU5w@mail.gmail.com>
	<651677.1622998017@sss.pgh.pa.us>
	<CAM+6J96CBUsAYtkmhEKAc_svADRZR114tOT0eRZngRxUCnkC-w@mail.gmail.com>
	<62388a6b-3d5e-011e-5549-ba0f3b505b3e@aklaver.com>
	<CAM+6J94LTTcb3htdyxHWJivs3uZ7CyEn6zD0rqG07EZEGRkUuQ@mail.gmail.com>

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 <adrian.klaver@aklaver.com 
> <mailto:adrian.klaver@aklaver.com>> 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
>     <https://www.postgresql.org/docs/13/config-setting.html#CONFIG-INCLUDES;
> 
> 
>      >
>      >
>      > On Sun, 6 Jun 2021 at 22:17, Tom Lane <tgl@sss.pgh.pa.us
>     <mailto:tgl@sss.pgh.pa.us>
>      > <mailto:tgl@sss.pgh.pa.us <mailto:tgl@sss.pgh.pa.us>>> wrote:
>      >
>      >     RAJAMOHAN <garajamohan@gmail.com
>     <mailto:garajamohan@gmail.com> <mailto:garajamohan@gmail.com
>     <mailto:garajamohan@gmail.com>>> 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 <mailto:adrian.klaver@aklaver.com>
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (7+ messages)  latest in thread

Message-ID: <fb95d3b3-771d-82af-201d-254ad29b7699@aklaver.com>
Permalink:  ../fb95d3b3-771d-82af-201d-254ad29b7699@aklaver.com/
Also on:    postgresql.org/message-id/fb95d3b3-771d-82af-201d-254ad29b7699@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, vijaykumarjain.github@gmail.com
  Subject: Re: Symbolic link breaks for postgresql.auto.conf
  In-Reply-To: <fb95d3b3-771d-82af-201d-254ad29b7699@aklaver.com>
  References: <CAFzdntuKqBv9wYcKVHutJSTypG12z+2dPJZd4d7hnTeyzcuU5w@mail.gmail.com> <651677.1622998017@sss.pgh.pa.us> <CAM+6J96CBUsAYtkmhEKAc_svADRZR114tOT0eRZngRxUCnkC-w@mail.gmail.com> <62388a6b-3d5e-011e-5549-ba0f3b505b3e@aklaver.com> <CAM+6J94LTTcb3htdyxHWJivs3uZ7CyEn6zD0rqG07EZEGRkUuQ@mail.gmail.com> <fb95d3b3-771d-82af-201d-254ad29b7699@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox