(1) select 36588::regclass;
2、找到哪个表有问题后,先对该表做一下简单的修复: REINDEX table pg_toast.pg_toast_36588; REINDEX table c.xxxxx; VACUUM ANALYZE c.xxxxx; --------- (3)查找行 DO $$ declare v_rec record; BEGIN for v_rec in SELECT * FROM c.xxxxx loop raise notice 'aa%',v_rec.ctid; raise notice 'bb%',v_rec; end loop; END; $$ LANGUAGE plpgsql; 先打印ctid,再打印数据。 碰到有问题的行,会打印出ctid,就知道哪个错了 --------- (4)删除错误行 delete FROM c.xxxxx where ctid ='(81,98)';
(5)如此反复。
|