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

From: Zoltán Böszörményi <zb(at)cybertec(dot)at>
To: Amit kapila <amit(dot)kapila(at)huawei(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 'Robert Haas' <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]
Date: 2013-01-22 13:39:36
Message-ID: 50FE9698.4020006@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2013-01-22 13:32 keltezéssel, Amit kapila írta:
> On Saturday, January 19, 2013 2:37 AM Boszormenyi Zoltan wrote:
> 2013-01-18 21:48 keltezéssel, Boszormenyi Zoltan írta:
>> 2013-01-18 21:32 keltezéssel, Tom Lane írta:
>>> Boszormenyi Zoltan <zb(at)cybertec(dot)at> writes:
>>>> 2013-01-18 11:05 keltezéssel, Amit kapila írta:
>>>>>> On using mktemp, linux compilation gives below warning
>>>>>> warning: the use of `mktemp' is dangerous, better use `mkstemp'
>
>>>> Everywhere else that we need to do something like this, we just use our
>>>> own PID to disambiguate, ie
>>>> sprintf(tempfilename, "/path/to/file.%d", (int) getpid());
>>>> There is no need to deviate from that pattern or introduce portability
>>>> issues, since we can reasonably assume that no non-Postgres programs are
>>>> creating files in this directory.
>>> Thanks for the enlightenment, I will post a new version soon.
>> Here it is.
> The patch sent by you works fine.
> It needs small modification as below:
>
> The "auto.conf.d" directory should follow the postgresql.conf file directory not the data_directory.
> The same is validated while parsing the postgresql.conf configuration file.
>
> Patch is changed to use the postgresql.conf file directory as below.
>
> StrNCpy(ConfigFileDir, ConfigFileName, sizeof(ConfigFileDir));
> get_parent_directory(ConfigFileDir);
> /* Frame auto conf name and auto conf sample temp file name */
> snprintf(AutoConfFileName, sizeof(AutoConfFileName), "%s/%s/%s",
> ConfigFileDir,
> PG_AUTOCONF_DIR,
> PG_AUTOCONF_FILENAME);

Maybe it's just me but I prefer to have identical
settings across all replicated servers. But I agree
that there can be use cases with different setups.

All in all, this change makes it necessary to run the
same SET PERSISTENT statements on all slave servers,
too, to make them identical again if the configuration
is separated from the data directory (like on Debian
or Ubuntu using the default packages). This needs to be
documented explicitly.

>
> This closes all comments raised till now for this patch.
> Kindly let me know if you feel something is missing?

I can't think of anything else.

Best regards,
Zoltán Böszörményi

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2013-01-22 14:07:55 Re: Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]
Previous Message Thom Brown 2013-01-22 13:37:21 Re: Event Triggers: adding information