In going through some parameter file cleanup and re-factoring, I've been using the hba_file parameter to specify a non-standard file location. I tried using a relative location, thinking it would be relative to $PGDATA but in actuality it is relative to the pwd of my bash session that starts the database.For example, if I'm in /tmp when I run "pg_ctl start", it will look for the hba_file value under /tmp. If I change to $PGDATA/pg_log, it will look under there.Obviously I can change to an absolute path and not worry about it, but I'm curious if this is the intended behavior.
Its the documented behavior.
"When setting any of these parameters, a relative path will be interpreted with respect to the directory in which postgres is started."
Why would we want that hba_file value to be relative to something as volatile as pwd?
Why do you want it under PGDATA but not in the root directory thereof?
Since there is no "config_directory" option the current behavior at least allows the user to substitute "pwd" for "config_directory" and then set "data_directory" separately. Seems like reasonable flexibility to cater to the Debian-esque file system layout while leaving the typical core use case to just set pwd == "data_directory" and drop everything in there.
In any case if you are going to use relative paths then "pwd" should be a considered part of the architecture and not something that is considered "volatile". That seems to be how most programs behave and I don't see much advantage for PostgreSQL to be different in this regard.
David J.