On Wed, Jun 03, 2020 at 02:45:50PM -0400, Tom Lane wrote:
> In the abstract, I agree with Peter's point that we shouldn't alter
> user-given strings without need. However, I think there's strong
> reason for canonicalizing the data directory and config file locations.
> We access those both before and after chdir'ing into the datadir, so
> we'd better have absolute paths to them --- and at least for the
> datadir, it's documented that you can initially give it as a path
> relative to wherever you started the postmaster from. If the other
> files are only accessed after the chdir happens then we could likely
> do without canonicalizing them. But ... do we know which directory
> the user (thought he) specified them with reference to? Forced
> canonicalization does have the advantage that it's clear to all
> onlookers how we are interpreting the paths.
Even with the last point... It looks like there is little love for
this patch. So it seems to me that this brings the discussion down to
two points: shouldn't we document why canonicalization is not done for
data_directory, config_file, hba_file and ident_file with some
comments in guc.c? Then, why do we apply it to external_pid_file,
Log_directory and stats_temp_directory knowing that we chdir to PGDATA
in the postmaster before they get used (as far as I can see)?
--
Michael