Re: Options given both on cmd-line and in the config with different values

From: Honza Horak <hhorak(at)redhat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Patrik Novotny <panovotn(at)redhat(dot)com>
Subject: Re: Options given both on cmd-line and in the config with different values
Date: 2021-04-15 16:29:07
Message-ID: 2d884859-1455-53bd-7821-c3e776569ac3@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4/14/21 7:55 PM, Tom Lane wrote:
> Honza Horak <hhorak(at)redhat(dot)com> writes:
>> I'm trying to understand what is happening in the following bug report:
>> https://bugzilla.redhat.com/show_bug.cgi?id=1935301
>
>> The upgrade process makes it a bit more difficult, but it seems to boil
>> down to this problem -- even when pg_ctl gets clear guidance where to
>> find datadir using -D option on the command-line, it forgets this
>> guidance once finding data_directory option in the postgresql.conf.
>
>> Is this the expected behavior actually?
>
> The rule actually is that -D on the command line says where to find
> the configuration file. While -D is then also the default for where
> to find the data directory, the config file can override that by
> giving data_directory explicitly.
>
> This is intended to support situations where the config file is kept
> outside the data directory for management reasons. If you are not
> actively doing that, I'd recommend *not* setting data_directory
> explicitly in the file.
>
> While I've not studied the bug report carefully, it sounds like the
> update process you're using involves copying the old config file
> across verbatim. You'd at minimum need to filter out data_directory
> and related settings to make that safe.

Thanks for explaining, it makes perfect sense. You're right that there
is some dbdata directory moving involved, so in that case removing
data_directory option from postgresql.conf makes sense.

Thanks,
Honza

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-04-15 16:37:48 Re: Replacing pg_depend PIN entries with a fixed range check
Previous Message Pavel Stehule 2021-04-15 16:11:40 Re: Schema variables - new implementation for Postgres 15