Is there any danger running /etc/init.d/postgresql 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.
No, there is no danger of restarting postgres using the init.
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.
The only way relations would disappear on a restart of Postgres, would be if they were temp tables or created relations within an open transaction. When the db restarts it would close all connections and thus all temp tables would be dropped and open transactions would be rolled back. But anything that was committed would be safe from a restart.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With