postgres重做日志触发表触发器

时间:2015-07-16 12:19:26

标签: postgresql triggers postgresql-8.4 redo

让我们说由于一些腐败,postgres会触发自动恢复。这导致重做从0 / 9A3F58开始"因为我可以在数据库日志中。作为恢复的一部分,我想它会尝试插入表的记录。它是否会导致该表的数据库插入触发器也被执行。我们正在使用postgres 8.4。

来自postgres日志的

片段:

2015-06-17 10:43:34 PDT LOG:  unexpected EOF on client connection
2015-06-17 10:43:34 PDT LOG:  unexpected EOF on client connection
2015-06-17 10:43:34 PDT LOG:  unexpected EOF on client connection
2015-06-17 10:43:34 PDT LOG:  unexpected EOF on client connection
2015-06-19 08:55:30 CDT LOG:  database system was interrupted; last known up at 2015-06-17 20:05:02 CDT
2015-06-19 08:55:30 CDT LOG:  database system was not properly shut down; automatic recovery in progress
2015-06-19 08:55:30 CDT LOG:  redo starts at 0/9A3F58
2015-06-19 08:55:30 CDT LOG:  incomplete startup packet
2015-06-19 08:55:30 CDT FATAL:  the database system is starting up
2015-06-19 08:55:30 CDT LOG:  record with zero length at 0/E90334
2015-06-19 08:55:30 CDT LOG:  redo done at 0/E90308
2015-06-19 08:55:30 CDT LOG:  last completed transaction was at log time     2015-06-17 12:43:32.471831-05
2015-06-19 08:55:31 CDT LOG:  database system is ready to accept connections
2015-06-19 08:55:31 CDT LOG:  autovacuum launcher started
2015-06-19 08:59:29 CDT LOG:  unexpected EOF on client connection
2015-06-19 08:59:29 CDT LOG:  unexpected EOF on client connection
2015-06-19 08:59:29 CDT LOG:  unexpected EOF on client connection

1 个答案:

答案 0 :(得分:0)

不,从预写日志重播绝对不会导致触发器触发。实际上,它们不能,因为预写日志存储块级更改,而不是行级更改,并且不知道哪个SQL语句更改了哪一行