1.故障原因前端无数据更新
排查程序日志发现数据库在收缩
报错信息
ERROR: database is not accepting commands to avoid wraparound data loss in database “testdb”
建议:Stop the postmaster and vacuum that database in single-user mode.
You might also need to commit or roll back old prepared transactions, or drop stale replication slots
执行sql查看时那个表年龄偏大造成数据量收缩
执行Vacuum freeze 模式名.库名
如果无法释放
停止数据库
su - postgres
/usr/local/postgresql-10.5/bin/pg_ctl stop -D 数据存放目录
/usr/local/postgresql-10.5/bin/postgres --signal -D 数据存放目录 数据库名 进入单用户模式
vacuum freeze 释放整个库
在单用户模式下执行sql
vacuum freeze 模式名.表名