Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres.app configuration (port and other options)

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?

like image 419
Igor Artamonov Avatar asked Nov 03 '12 17:11

Igor Artamonov


People also ask

What ports can I use for PostgreSQL?

The PostgreSQL database service is available on localhost and the default PostgreSQL port is 5432 .

How do I specify a port in PostgreSQL?

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.

What are the key configuration files in PostgreSQL?

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 port number should PostgreSQL listen on?

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.


2 Answers

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)

like image 116
Paul Avatar answered Nov 15 '22 16:11

Paul


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.

like image 35
kyrre Avatar answered Nov 15 '22 15:11

kyrre