Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]

From: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
To: "'Andres Freund'" <andres(at)2ndquadrant(dot)com>
Cc: "'Greg Stark'" <stark(at)mit(dot)edu>, "'Greg Smith'" <greg(at)2ndquadrant(dot)com>, "'Boszormenyi Zoltan'" <zb(at)cybertec(dot)at>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]
Date: 2013-03-13 13:22:48
Message-ID: 005701ce1fed$dc10c5c0$94325140$@kapila@huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday, March 13, 2013 6:44 PM Andres Freund wrote:
> On 2013-03-13 18:38:12 +0530, Amit Kapila wrote:
> > On Wednesday, March 13, 2013 6:10 PM Andres Freund wrote:
> > > On 2013-03-12 10:46:53 +0530, Amit Kapila wrote:
> > > > Do you mean to say that because some variables can only be set
> after
> > > restart
> > > > can lead to
> > > > inconsistency, or is it because of asynchronous nature of
> > > pg_reload_conf()?
> > >
> > > As long as SET PERSISTENT cannot be executed inside a transaction -
> or
> > > only takes effect after its end - there doesn't seem to be any
> problem
> > > executing ProcessConfigFile() directly.
> >
> > Do you mean to say we call directly ProcessConfigFile() at end of SET
> > PERSISTENT instead
> > Of pg_reload_conf() but in that case would it load the variables for
> other
> > backends?
>
> I'd say do both. Yes, we would evaluate config potentially twice. Who
> cares. Messages inside non-postmaster environments are only output at
> DEBUG2
> anyway.

I could see your point, when you say do both that you want that in current
session,
the values will be immediately available which can make user happy.
However if there is any error during function ProcessConfigFile(), it could
be little
inconvenient for user as the setting would have been done in file but memory
processing
has created problem.
Ideally, there should not be any error in function ProcessConfigFile(), but
might be some palloc or such call
would be sufficient to make user unhappy.

With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2013-03-13 13:46:56 Re: Writable foreign tables: how to identify rows
Previous Message Andres Freund 2013-03-13 13:13:40 Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]