Postgresql - 错误解决 - 9.3 - database is not accepting commands to avoid wraparound data......

数据库日志和程序日志中都有报错

ERROR:  database is not accepting commands to avoid wraparound data loss in database "template1"
HINT:  Stop the postmaster and use a standalone backend to vacuum that database.
	You might also need to commit or roll back old prepared transactions.
CONTEXT:  SQL statement "UPDATE XXX SET min_horizon = buffer_ts WHERE peer = peer_id"
	PL/pgSQL function kv.XXX(regclass,integer) line 21 at SQL statement

其实提示中说的很明确,

  1. 关闭数据库
  2. 进入standalone backend模式
  3. vacuum数据库

所以跟着这个步骤。执行

service postgresql stop
su - postgres
$ postgres --single -D /usr/local/pgsql/data DBNAME

PostgreSQL stand-alone backend 9.3.21
backend> vacuum freeze XXX;
2019-12-13 03:11:59 EST [79657]: [1-1] user=,db=  LOG:  duration: 14309.933 ms  statement: vacuum freeze XXX;

启动数据库,观察日志。解决~

发布了213 篇原创文章 · 获赞 7 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/chuckchen1222/article/details/103529441
9.3