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

WindowsPostgresql

Windows Problem Overview


I'm receiving 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?

Windows Solutions


Solution 1 - Windows

On my machine:

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

Solution 2 - Windows

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.

Solution 3 - Windows

You can find it by following this path

C:\Program Files\PostgreSQL\13\data

Solution 4 - Windows

On my machine:

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

Solution 5 - Windows

you will get postgressql.conf file

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionpythondjangoView Question on Stackoverflow
Solution 1 - WindowsjonescbView Answer on Stackoverflow
Solution 2 - WindowssplashView Answer on Stackoverflow
Solution 3 - WindowsBoris KamtouView Answer on Stackoverflow
Solution 4 - WindowsJustiView Answer on Stackoverflow
Solution 5 - WindowsShilpa Jayant PatilView Answer on Stackoverflow