Re: postgresql.auto.conf read from wrong directory

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Christoph Berg <cb(at)df7cb(dot)de>, Andres Freund <andres(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgresql.auto.conf read from wrong directory
Date: 2014-05-11 04:18:06
Message-ID: CAA4eK1JFnDr0=PinqPOY0CVETPs20nqSd0_DnVoGiRV8gWDBpA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, May 11, 2014 at 4:38 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> ISTM that data_directory is in different situation from the other. That is,
> setting data_directory in postgresql.auto.conf is problematic whether its
> setting value is valid or invalid. Imagine the case where data_directory
> is set to '/data1' and '/data2' in config_directory/postgresql.conf and
> /data1/postgresql.auto.conf, respectively. In this case, firstly the server
> doesn't read /data2/postgresql.auto.conf when it starts up, even if your
> patch has been applied.

I think after my patch, first server will read data1/postgresql.auto.conf
on start as that is what is set in postgresql.conf.

> Secondly, the server doesn't read
> /data1/postgresql.auto.conf when it receives SIGHUP, and this causes
> the following error.
>
> LOG: parameter "data_directory" cannot be changed without restarting the server

This happens because data_directory is PGC_POSTMASTER parameter
and none of such parameters can be changed with SIGHUP.

In above scenario, I think you are expecting it should use
/data2/postgresql.auto.conf and that is what you have mentioned
up-thread. The way to handle it by server is just to forbid setting
this parameter
by Alter System or the user himself should not perform such an action.
Here if we want user to be careful of performing such an action, then may
be it's better to have such an indication in ALTER SYSTEM documentation.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-05-11 05:37:55 Re: 9.5: UPDATE/DELETE .. ORDER BY .. LIMIT ..
Previous Message Tom Lane 2014-05-11 02:09:38 Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation)