3

我花了很多时间来查找Postgres配置文件,例如pg_hba.confpostgresql.conf不同的 linux 发行版以及postgres 版本本身!我很困惑......

4

2 回答 2

12

最后我找到了它的全局解决方案。

首先,您应该遵循以下步骤:

  1. su - postgres
  2. psql
  3. 对于 postgres配置文件

    SHOW config_file;

输出应该是这样的:

postgres=# SHOW config_file;
                   config_file
    ------------------------------------------
     /etc/postgresql/9.6/main/postgresql.conf
    (1 row)

对于hba_file使用:

SHOW hba_file;
于 2017-12-13T10:24:08.763 回答
3

如果您的实例未启动并且您不能

select current_setting('hba_file')

或者

select setting from pg_settings where name = 'hba_file'

或者

psql -c 'show hba_file'

你可以找到它们:

find / -name pg_hba.conf
于 2017-12-13T12:29:04.807 回答