我当前已经安装了一个 pgsql 实例,该实例运行在端口 1486上。我想改变这个端口到 5433,我应该如何继续这个?
1486
5433
There should be a line in your postgresql.conf file that says:
postgresql.conf
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/
/etc/postgresql/8.3/main/
On Windows it is C:\Program Files\PostgreSQL\9.3\data
C:\Program Files\PostgreSQL\9.3\data
Don't forget to sudo service postgresql restart for changes to take effect.
sudo service postgresql restart
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.