Stephen Frost escribió:
> I agree that auto.conf should live in $PGDATA, but I really don't like
> the idea of conf.d being relative to some other existing file. It
> should be included through an 'includedir' option, not just picked up as
> some magic directory name, and therefore consider the current
> arrangement of parameters in Debian:
>
> data_directory = '/var/lib/postgresql/9.2/main'
> hba_file = '/etc/postgresql/9.2/main/pg_hba.conf'
> ident_file = '/etc/postgresql/9.2/main/pg_ident.conf'
>
> and postgres is started like so:
>
> /usr/lib/postgresql/9.2/bin/postgres -D /var/lib/postgresql/9.2/main -c
config_file=/etc/postgresql/9.2/main/postgresql.conf
>
> With the proposed include line for auto.conf, which lives in $PGDATA,
> we'd have:
>
> include 'auto.conf'
>
> Would we then have
>
> includedir 'conf.d'
>
> which is relative to postgresql.conf instead?
Well, all the relative paths in include/includedir directives would be
relative to the directory specified by the -c config_file param, which
makes perfect sense. So the conf.d would work fine in your example.
The only problem I see in your snippet above is the "include auto.conf"
line, which doesn't make any sense because that file would not be found.
Hence my proposal that the file ought to be read automatically, not via
an include line. Sadly I don't think we cannot just make it an absolute
path, in case the data dir is moved or whatever; the only choice I see
would be to have something like
include-data 'auto.conf'
or something like that which tells the system that the file is not in
the config dir but in the data dir instead. A nearby comment could let
the user know about this file being in the data directory instead of the
config directory.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services