I just installed Postgres.app on my Mac, and I need to make some specific configuration to server. For example I want to use different port, not 5432.
I found that it have postgresql.conf
at ~/Library/Application\ Support/Postgres/var/postgresql.conf
, but even if I change value of port =
to something other, it listen on 5432 after server restart.
Seems that this postgresql.conf
isn't used by Postgress.app. Where it stores server configuration files?
The PostgreSQL database service is available on localhost and the default PostgreSQL port is 5432 .
Open the postgresql configuration file in any text edit. The default file location is C:\Program Files\PostgreSQL\<version>\data. Change the port number in the Connections and Authentication section of the configuration file. Choose File > Save to save the new port number.
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.
The TCP port the server listens on; 5432 by default. Note that the same port number is used for all IP addresses the server listens on.
The postgresql.conf-file at ~/Library/Application\ Support/Postgres/var/
is used by Postgres.app. The only problem: if you change the port in that file, that change will not be reflected in the menu-bar. So the elephant over there will still say "Running on Port 5432", although postgres might be running on, for example, port 5433. (Mac OS X 10.8.2, Server.app 2.2, Postgres.app 9.2.2.0)
I can see the output from ps aux |grep post
/Applications/Postgres.app/Contents/MacOS/bin/postgres -D /Users/chenc26/Library/Application Support/Postgres/var -p5432
So I think there must be some config in this app to specify the CLI parameter which ignore the value from config file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With