I have Postgresql 9.3 and 9.4 installed on my Linux Mint machine. How can I restart postgresql 9.4? A method to restart both versions together is also fine.
Try this as root (maybe you can use sudo
or su
):
/etc/init.d/postgresql restart
Without any argument the script also gives you a hint on how to restart a specific version
[Uqbar@Feynman ~] /etc/init.d/postgresql
Usage: /etc/init.d/postgresql {start|stop|restart|reload|force-reload|status} [version ...]
Similarly, in case you are using systemd
you can also use the service
tool:
[Uqbar@Feynman ~] service postgresql
Usage: /etc/init.d/postgresql {start|stop|restart|reload|force reload|status} [version ...]
Please, pay attention to the optional [version ...]
trailing argument.
That's meant to allow you, the user, to act on a specific version, in case you were running multiple ones. So you can restart version X while keeping version Y and Z untouched and running.
You can also restart postgresql by using this command, should work on both the versions :
sudo service postgresql start
来源:https://stackoverflow.com/questions/34918025/how-to-restart-postgresql