Postgres.app configuration (port and other parameters)

I just installed Postgres.app on my Mac and I need to make a specific configuration on the server. For example, I want to use a different port, not 5432.

I found that it has postgresql.conf in ~/Library/Application\ Support/Postgres/var/postgresql.conf , but even if I change the port = value to something else, it listens for 5432 after the server restarts.

It seems that this postgresql.conf not used by Postgress.app. Where does it store server configuration files?

+7
source share
4 answers

The postgresql.conf file in ~/Library/Application\ Support/Postgres/var/ used by Postgres.app. The only problem: if you change the port in this file, this change will not be reflected in the menu bar . Thus, the elephant there will still say β€œRun on port 5432”, although postgres can work, for example, port 5433. (Mac OS X 10.8.2, Server.app 2.2, Postgres.app 9.2.2.0)

+11
source

I see the result from ps aux |grep post /Applications/Postgres.app/Contents/MacOS/bin/postgres -D / Users / chenc26 / Library / Application Support / Postgres / var -p5432 Therefore, I think that this application should have some kind of configuration to indicate a CLI parameter that ignores the value from the configuration file.

+2
source

I run Mavericks 10.9.3 and open the Postgres app v9.3 configuration via nano ~/Library/Application\ Support/Postgres/var-9.3/postgresql.conf and uncomment the line port = 5432 and then change it, say, to 5433 trick for me. (An application restart was required, as mentioned in the configuration file). After that, the application correctly displays that it is running on port 5433.

+2
source

If you correctly modify the contents of postgresql.conf, restarting the PostgreSQL server will not change the port it is listening on, you will almost certainly edit the incorrect postgresql.conf.

On other platforms, PostgreSQL places a copy of its default version of postgresql.conf in the data directory. Thus, you can find at least two copies of all configuration files somewhere on your computer - usually one in the directory where the distribution or source was downloaded or uncompressed, and one in the data directory. On your Mac, if you are using version 9.1, the data directory may be

 /Library/PostgreSQL/9.1/data/ 

Check for postgresql.conf. If you find it, consider making a copy to replace the one you edited. (So ​​the one you edited will again be an unedited version.)

0
source

All Articles