Restart PostgreSQL Remotely

Dino picture Dino · Jul 10, 2011 · Viewed 16.6k times · Source

Can I remotely restart a PostgreSQL server throught PGAdmin ? The user I currently is the administrative privileges.

Regards,

Dino

Answer

Grzegorz Szpetkowski picture Grzegorz Szpetkowski · Jul 10, 2011

I don't think there is such possibility. At best you can reload connected PostgreSQL server using pg_reload_conf() function:

pg_reload_conf sends a SIGHUP signal to the server, causing configuration files to be reloaded by all server processes.

Command:

SELECT pg_reload_conf();

You can also install adminpack contrib module and reload server using Tools menu.

EDIT:

According to pgAdmin documentation:

If pgAdmin is running on a Windows machine, it can control the postmaster service if you have enough access rights. Enter the name of the service. In case of a remote server, it must be prepended by the machine name (e.g. PSE1\pgsql-8.0). pgAdmin will automatically discover services running on your local machine.

If pgAdmin is running on a Unix machine, it can control processes running on the local machine if you have enough access rights. Enter a full path and needed options to access the pg_ctl program. When executing service control functions, pgAdmin will append status/start/stop keywords to this. Example: sudo /usr/local/pgsql/bin/pg_ctl -D /data/pgsql

You can try use Start Service/Stop Service options (in Tools menu) to restart remote server.