template0 template1 数据库 是模板数据库.
template0 是不允许链接的.
数据库频繁的更新后. xid 用完了.
datname | xid_age | av_wrap_pct | shutdown_pct | gb_size
-----------+-----------+-------------+--------------+---------
template0 | 198697852 | 99.3 | 9.0 | 59.9
(1 行记录)
怎么搞呢 .
需要 vacuum freeze 了 .
select * from pg_database;
pconline=> select * from pg_database where datname='template0';
-[ RECORD 1 ]-+------------------------------------
datname | template0
datdba | 10
encoding | 6
datcollate | C
datctype | C
datistemplate | t
datallowconn | f
datconnlimit | -1
datlastsysoid | 13157
datfrozenxid | 866733911
datminmxid | 6
dattablespace | 1663
datacl | {=c/postgres,postgres=CTc/postgres}
update pg_database set datallowconn='t' where datname='template0';
\c template0
template0=# vacuum freeze ;
VACUUM
update pg_database set datallowconn='f' where datname='template0';
切记 , 处理完后, 一定要把 允许登录关闭. 不要给自己找不自在.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/133735/viewspace-2845101/ ,如需转载,请注明出处,否则将追究法律责任。