Windows 上的 Postgresql 配置文件:'postgresql.conf' 在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4465475/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where is the Postgresql config file: 'postgresql.conf' on Windows?
提问by pythondjango
I'm receiving this message but I can't find the postgresql.conf file:
我收到此消息,但找不到 postgresql.conf 文件:
OperationalError: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting
TCP/IP connections on port 5432?
回答by jonescb
On my machine:
在我的机器上:
C:\Program Files\PostgreSQL\8.4\data\postgresql.conf
C:\Program Files\PostgreSQL\8.4\data\postgresql.conf
回答by splash
postgresql.conf
is located in PostgreSQL's data directory. The data directory is configured during the setup and the setting is saved as PGDATA
entry in c:\Program Files\PostgreSQL\<version>\pg_env.bat
, for example
postgresql.conf
位于PostgreSQL 的数据目录中。数据目录在设置过程中配置,设置保存为PGDATA
条目c:\Program Files\PostgreSQL\<version>\pg_env.bat
,例如
@ECHO OFF
REM The script sets environment variables helpful for PostgreSQL
@SET PATH="C:\Program Files\PostgreSQL\<version>\bin";%PATH%
@SET PGDATA=D:\PostgreSQL\<version>\data
@SET PGDATABASE=postgres
@SET PGUSER=postgres
@SET PGPORT=5432
@SET PGLOCALEDIR=C:\Program Files\PostgreSQL\<version>\share\locale
Alternatively you can query your database with SHOW config_file;
if you are a superuser.
或者,SHOW config_file;
如果您是超级用户,您可以查询您的数据库。
回答by Justi
On my machine:
在我的机器上:
C:\Program Files (x86)\OpenERP 6.1-20121026-233219\PostgreSQL\data