Postgresql – change pgsql port

postgresql

I have currently an installed pgsql instance that is running on port 1486. I want to change this port to 5433, how should I proceed for this?

Best Solution

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.