Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change pgsql port [duplicate]

Tags:

postgresql

People also ask

Can you change Postgres port?

The default TCP port for PostgreSQL is usually 5432, however this can easily be changed in the postgresql. conf configuration file, which is the main configuration file for the database server.

What is the default port for PostgreSQL?

Connecting to Your Database The PostgreSQL database service is available on localhost and the default PostgreSQL port is 5432 .

How can I tell if Postgres is running on port 5432?

Usually Postgres is the only app interested in using port 5432, but if after issuing the first command to see what is running on port 5432, you find out that there is an application other than PostgreSQL running on port 5432, try to check the activity monitor and see what app might be interfering with your PostgreSQL ...


There should be a line in your postgresql.conf file that says:

port = 1486

Change that.

The location of the file can vary depending on your install options. On Debian-based distros it is /etc/postgresql/8.3/main/

On Windows it is C:\Program Files\PostgreSQL\9.3\data

Don't forget to sudo service postgresql restart for changes to take effect.


You can also change the port when starting up:

$ pg_ctl -o "-F -p 5433" start

Or

$ postgres -p 5433

More about this in the manual.