我最近在Ubuntu上安装了PostgreSQL和EnterpriseDB包。我可以连接到本地数据库,但我不能配置它,因为我找不到配置文件。我搜索了整个硬盘驱动器,只找到了像pg_hba.conf.sample这样的样本

PostgreSQL .conf文件在哪里?


当前回答

Ubuntu 13.04使用软件中心安装:

我的位置是:

/etc/postgresql/9.1/main/postgresql.conf

其他回答

在Mac上(使用brew安装Postgres):

/usr/local/Cellar/postgresql/9.3.3>bin/postgres -D /usr/local/var/postgres/

我把它定位在这里:

/var/lib/pgsql/9.6/data/postgresql.conf

2022-4-25更新:

地点:/ Library / PostgreSQL / 14 /数据/ postgresql.conf

系统:MacOS Monterey

只是给那些正在寻找这条道路的人……

Ubuntu 13.04使用软件中心安装:

我的位置是:

/etc/postgresql/9.1/main/postgresql.conf

如果您刚刚安装了它,locate可能不起作用。在这种情况下,服务应该正在运行,您可以运行

ps aux  | grep 'postgres *-D'

查看postgresql-master从哪里加载配置文件。