Re: postgresql.auto.conf and reload - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: postgresql.auto.conf and reload
Date
Msg-id 20140625142226.GJ29108@msg.df7cb.de
Whole thread Raw
In response to Re: postgresql.auto.conf and reload  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: postgresql.auto.conf and reload  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
Re: Amit Kapila 2014-06-25 <CAA4eK1+F9ZtoGvVw-WYj2+vT0K8_JXTziqHp8iVB7wdo1w1Rkw@mail.gmail.com>
> The main reason behind such such a behaviour after restart is
> that there are duplicate entries, one in postgresql.conf and
> another in postgresql.conf.  It always first read postgresql.conf
> and then .auto file and applies the changed parameters one by one,
> so when it reads a different value than current setting, it can lead
> to such messages.  During processing of config files it doesn't try
> to eliminate duplicate entries.
> 
> You can observe same behaviour incase you have another conf
> file (special.conf, containing conflicting settings) and include that
> in postgresql.conf.

Or even two statements for the same guc in postgresql.conf itself.

> One way could be that while processing if we could eliminate
> duplicate entries, then it will not lead to such messages, but I think
> that is existing mechanism and not introduced by Alter System,
> so changing just for Alter System might impact some existing users.

Yes, it's the same mechanism as before, but now we have a tool that
was specifically meant to be used to set and override postgresql.conf
parameters, so duplicate entries in postgresql.conf and
postgresql.auto.conf are no longer user error (or weirdness), but
expected. The system should deal with it.

> I think maintaining values both in postgresql.conf and by Alter System
> is not advisable.

Possibly, but then the system should be warning about all options, not
just the restart-only ones. And it should warn at startup, not at
reload time.

> I am not sure if this addresses your concern completely, but I thinking
> changing some existing mechanism (maintaining duplicate entries during
> processing of config files) at this point might be risky.

Not sure how intrusive a fix would be - collect all settings during
config parse, and only warn once everything has been seen, instead of
emitting warnings line-by-line.

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: postgresql.auto.conf and reload
Next
From: Stephen Frost
Date:
Subject: Re: RLS Design the rewriter into the planner?