pg_hba.conf 在 Manjaro 的位置

Where is pg_hba.conf is located in Manjaro

所以,我已经使用 yaourt 安装程序包在我的 Linux Manjaro 17.1.1 中安装了 PostgreSQL 10.1。

yaourt -S postgresql

从这里我无法在本地连接数据库,因此,在搜索时我发现 告诉我应该找到 pg_hba.conf 文件(第 3 步)

我试图在终端中使用此命令找到 pg_hba.conf 文件

sudo find / -name *pg_hba*`

但还是找不到文件,我只在这里找到了一个示例文件:

/usr/share/postgresql/pg_hba.conf.sample

我尝试再次使用yaourt重新安装软件包,但仍然无效。我错过了什么吗?

谢谢

更新

所以,这是我在尝试连接到数据库时遇到的错误。

psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/run/postgresql/.s.PGSQL.5432"?

所以,我发布后几分钟就解决了这个问题。愚蠢的我,我没有仔细阅读this page的说明。

显然,我还需要一些步骤才能完成安装。我需要 运行 下面的命令:

Before PostgreSQL can function correctly, the database cluster must be initialized:

[postgres]$ initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'

然后,启动并启用 postgresql.service:

As root, start and enable postgresql.service. See #Upgrading PostgreSQL for necessary steps before installing new versions of the PostgreSQL packages.

现在,安装完成后,我可以使用下面的命令找到配置文件。

sudo find / -name pg_hba.conf