Re: Merging postgresql.conf and postgresql.auto.conf

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Merging postgresql.conf and postgresql.auto.conf
Date: 2015-01-15 05:02:50
Message-ID: CAA4eK1Ku66Byk3hmnnswkhnU_OftQc2Mm0JqFwXo_y=rC6JPSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 14, 2015 at 9:01 PM, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>
wrote:
>
> Hi all,
>
> The postgresql.auto.conf is loaded after loading of postgresql.conf
> whenever configuration file is loaded or reloaded.
> This means that parameter in postgresql.auto.conf is quite high
> priority, so the parameter in postgresql.conf does not work at all
> even if user set it manually.
>
> If user want to change stopped postgresql server then user need to
> merge two configuration file(postgresql.conf and postgresql.auto.conf)
> while maintaining the consistency manually.
>

I think one way to currently do it is with the help of Alter System .. Reset
command. Basically user can check via pg_settings, if the variable
belongs to postgresql.auto.conf and he knows already a duplicate copy
of same is available in postrgresql.conf and that is the value he want to
use, then RESET command could be used to remove the setting from
postgresql.auto.conf

> From an operational perspective having a written config with duplicate
> entries is not good thing.
> I think we need to merge two configuration file into one (or more than
> one, if it uses like 'include' word)
>
> The one solution is to add merging tool/commnand which merges two
> configuration file while maintaining the consistency.

If you want to think of some solution which can make the usage of Alter
System more convenient, then we should think only in terms of change/
remove the value in postgresql.auto.conf as that is the place where we
have added values programatically.

One thought I have in this line is that currently there doesn't seem to be
a way to know if the setting has an entry both in postgresql.conf and
postgresql.auto.conf, if we can have some way of knowing the same
(pg_settings?), then it could be convenient for user to decide if the value
in postgresql.auto.conf is useful or not and if it's not useful then use
Alter System .. Reset command to remove the same from
postgresql.auto.conf.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-01-15 05:30:00 Re: pg_rewind in contrib
Previous Message Peter Geoghegan 2015-01-15 04:50:05 Re: hung backends stuck in spinlock heavy endless loop