Restart postgres on Production machines without /etc/init.d/postgresql restart

If you want to avoid having to cycle the DB (i.e.: /etc/init.d/postgres restart), you can do this on the command line (as root):

kill -HUP `pidof postgres`

Once you do that, you will notice a message like this in the /var/log/postgresql/postgresql-9.4-main.log:

“2017-01-19 15:33:11 PST [24237-2] LOG: received SIGHUP, reloading configuration files”

Postgres receives the “hang up” (HUP) signal from the kill command and it knows to re-read the configuration files without taking the database down – ZERO outage.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s