Restart postgres

Is there any danger of /etc/init.d/postgresql restart ? We just had an incident when some relationships "disappeared", and I ran on the specified command. It was just hacked by the system administrator, but he did not justify why it was bad. I put webapp in maintenance mode, so there were no transactions / requests at that time.




Thanks guys ... In short, it will not hurt anything, but it can lose a lot of useful diagnostic information.

+48
postgresql
Sep 01 '10 at 17:23
source share
3 answers

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

However, restarting it because something strange happened is not a good idea, because it severely limits the amount of information you can collect to find the root cause and limits the possibilities for correcting it.

Also, for all the years when I was engaged in postgresql, I never faced a situation where restarting "fixed" the problem. The immediate β€œincident” can be resolved, but if there is a problem, it will still be there.

+45
Sep 01 '10 at 17:38
source share

The only way the relationship disappeared when restarting Postgres is if they were temporary tables or relationships were created as part of an open transaction. When db restart is complete, all connections will be closed, and thus, all temporary tables will be reset, and open transactions will be canceled. But everything that was committed would be safe after a reboot.

+5
Nov 29 '11 at 23:19
source share

Relationships do not disappear due to a restart, you may lose some running transactions, but this is so. PostgreSQL does not destroy your database upon restart, do not worry.

+3
Sep 01 '10 at 17:29
source share



All Articles