Re: [ADMIN] Using hba_file parameter and relative path

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [ADMIN] Using hba_file parameter and relative path
Дата
Msg-id CAKFQuwbN=CHd05yTx5TAmkmFPL78veULTXcu5gnGxCgFVLpdyQ@mail.gmail.com
обсуждение исходный текст
Ответ на [ADMIN] Using hba_file parameter and relative path  (Don Seiler <don@seiler.us>)
Ответы Re: [ADMIN] Using hba_file parameter and relative path  (Don Seiler <don@seiler.us>)
Список pgsql-admin
On Thu, Sep 28, 2017 at 11:47 AM, Don Seiler <don@seiler.us> wrote:
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.

В списке pgsql-admin по дате отправления:

Предыдущее
От: Don Seiler
Дата:
Сообщение: [ADMIN] Using hba_file parameter and relative path
Следующее
От: Don Seiler
Дата:
Сообщение: Re: [ADMIN] Using hba_file parameter and relative path