Postgres在Linux中查找配置文件

S.H*_*ahi 2 postgresql postgresql-9.1 postgresql-9.6 pg-hba.conf

我花了很多时间来查找类似或在Linux的不同发行版中Postgres配置文件,以及postgres版本本身!我很困惑pg_hba.confpostgresql.conf

S.H*_*ahi 7

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

首先,您应该按照以下步骤操作:

  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)
Run Code Online (Sandbox Code Playgroud)

对于hba_file使用:

SHOW hba_file;
Run Code Online (Sandbox Code Playgroud)