Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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? 
like image 249
pythondjango Avatar asked Dec 16 '10 21:12

pythondjango


People also ask

Where is the PostgreSQL conf file located?

PostgreSQL configuration files are stored in the /etc/postgresql/<version>/main directory. For example, if you install PostgreSQL 12, the configuration files are stored in the /etc/postgresql/12/main directory. To configure IDENT authentication, add entries to the /etc/postgresql/12/main/pg_ident. conf file.

What is PostgreSQL conf file in PostgreSQL?

conf is PostgreSQL's main configuration file and the primary source of configuration parameter settings. postgresql. conf is a plain text file generated by initdb and is normally stored in the data directory. However some distributions' packages may place postgresql.

What is Pg_hba conf file?

conf File. Client authentication is controlled by a configuration file, which traditionally is named pg_hba. conf and is stored in the database cluster's data directory. ( HBA stands for host-based authentication.)


2 Answers

On my machine:

C:\Program Files\PostgreSQL\8.4\data\postgresql.conf 
like image 98
jonescb Avatar answered Oct 03 '22 16:10

jonescb


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.

like image 38
splash Avatar answered Oct 03 '22 16:10

splash