postgresql Postgres在Linux中查找配置文件

dced5bon  于 2023-04-20  发布在  PostgreSQL
关注(0)|答案(2)|浏览(305)

我花了很多时间在不同的linux发行版postgres版本本身中找到Postgres配置文件,如pg_hba.confpostgresql.conf!我非常困惑...

0md85ypi

0md85ypi1#

最后,我找到了全局解决方案。
首先,您应该遵循以下步骤:
1.输入su - postgres,如果不起作用,则输入sudo -i -u postgres并点击Enter
1.键入psql并点击Enter
1.要查找postgres配置文件postgresql.conf的位置,请键入:

SHOW config_file;

输出应该是这样的:

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

1.要查找postgres pg_hba.conf文件的位置,请键入:

SHOW hba_file;

在那里,输出应该是这样的:

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

k97glaaz2#

如果您的示例尚未启动,并且无法

select current_setting('hba_file')

select setting from pg_settings where name = 'hba_file'

psql -c 'show hba_file'

你可以找到他们:

find / -name pg_hba.conf

相关问题