开发者

Where is the Postgresql config file: 'postgresql.conf' on Windows?

I'm receivin开发者_高级运维g this message but I can't find the postgresql.conf file:

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?


On my machine:

C:\Program Files\PostgreSQL\8.4\data\postgresql.conf


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

@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.


You can find it by following this path

C:\Program Files\PostgreSQL\13\data


On my machine:

C:\Program Files (x86)\OpenERP 6.1-20121026-233219\PostgreSQL\data


you will get postgressql.conf file

C:/programfiles/postgressql/14/data you will also get the pg_hba to check username password


PGDATA is assumed as ConfigDir under Postgresql, this works under docker and normal installation as well, this is default configuration until not changed explicitly.

on my docker PGDATA is configure as "/var/lib/postgresql/data" hence all configuration can be found under this directory.

#------------------------------------------------------------------------------
# FILE LOCATIONS
#------------------------------------------------------------------------------

# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.

#data_directory = 'ConfigDir'       # use data in another directory
                # (change requires restart)
#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
                # (change requires restart)
#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
                # (change requires restart)

# If external_pid_file is not explicitly set, no extra PID file is written.
#external_pid_file = ''         # write an extra PID file
                # (change requires restart)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜