tags:

views:

42

answers:

2

Is there any danger running /etc/init.d/postgres restart?? We just had an incident where some relations "disappeared" and I ran the said command. Just got bollocked by the sysadmin, however he did not justify why this was a bad thing to do. I did put the webapp in maintenance mode so there wasn't any transactions/ queries going on at the time.


Thanks guys... So in short it wont damage anything but it could loose lots of valuable diagnostic info.

A: 

Relations don't disappear because of a restart, you might loose some running transactions, but that's it. PostgreSQL does not destroy your database when it restarts, don't worry.

Frank Heikens
+1  A: 

No, there is no danger of restarting postgres using the init.d method.

However, to restart it because something weird happened is not a good idea, because it limits severely the amount of information you can collect to find the root cause and limits opportunities to fix it.

Also in all the years I have been involved with postgresql, I never encountered a situation in which a restart "fixed" the problem. The immediate 'incident' might be resolved but if there's a problem, it will still be there.

Peter Tillemans
Thanks. I knew it wouldn't fix the route problem but sysadmin was unavailable and the clients wanted their site back up.
Simon
You might want to keep a close eye on it and/or write a script which regularly checks if the error condition reappears so you have more time next time to do gather data and fix the problem before the customer calls.
Peter Tillemans