FAQ

[PostgreSQL] dump error parent table oid of pg_rewrite entry oid not found

Doug Kyle
Apr 7, 2010 at 8:38 pm
I have this error from pg_dumpall:
pg_dump: failed sanity check, parent table OID 27974 of pg_rewrite entry
OID 28689 not found


I found a rule was dropped when this server was setup as s Slony replica
because it conflicted with the Slony deny access trigger
select oid,rulename from pg_rewrite where oid=28689;
oid | rulename
-------+---------------------
28689 | protect_user_delete

the other oid looks to be a key for the table the rule was dropped from:
select * from pg_class where oid=27974;
relname | relnamespace | reltype | relowner | relam | relfilenode |
reltablespace | relpages | reltuples | reltoastrelid | reltoastidxid |
relhasindex | relisshared | relkind | relnatts | relchecks | reltriggers
relukeys | relfkeys | relrefs | relhasoids | relhaspkey | relhasrules
relhassubclass | relfrozenxid | relacl |
reloptions
----------+--------------+---------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+---------+----------+-----------+-------------+----------+----------+---------+------------+------------+-------------+----------------+--------------+--------+------------

usr_pkey | 24604 | 0 | 10 | 403 | 32459
0 | 1256 | 924158 | 0 | 0 |
f | f | i | 1 | 0 | 0
0 | 0 | 0 | f | f | f
f | 0 | |


and there 50 references to these OIDs in pg_depend:
select * from pg_depend where objid in (27974,28689) or refobjid in
(27974,28689);
classid | objid | objsubid | refclassid | refobjid | refobjsubid |
deptype
---------+-------+----------+------------+----------+-------------+---------

1259 | 27974 | 0 | 2606 | 27975 | 0 |
i
2618 | 28689 | 0 | 1259 | 24985 | 0 |
a
2618 | 28689 | 0 | 1259 | 24985 | 1 |
n
2606 | 28731 | 0 | 1259 | 27974 | 0 | n
2606 | 28756 | 0 | 1259 | 27974 | 0 | n
2606 | 28771 | 0 | 1259 | 27974 | 0 | n
2606 | 28786 | 0 | 1259 | 27974 | 0 | n
2606 | 28791 | 0 | 1259 | 27974 | 0 | n
<snip etc>

So I'm thinking I'll delete from pg_rewrite where oid=28689, but I'm not
sure if I should do anything with pg_class or pg_depends - or other
tables? Any advice?

Doug.
reply

Search Discussions

1 response

  • Tom Lane at Apr 7, 2010 at 9:05 pm

    Doug Kyle writes:
    I have this error from pg_dumpall:
    pg_dump: failed sanity check, parent table OID 27974 of pg_rewrite entry
    OID 28689 not found
    ...
    So I'm thinking I'll delete from pg_rewrite where oid=28689, but I'm not
    sure if I should do anything with pg_class or pg_depends - or other
    tables? Any advice?
    It's probably sufficient to drop the pg_rewrite entry. There are likely
    to be some pg_depend entries left behind but I don't think they are
    going to hurt you. If you want to be sure, try reloading the database
    from the dump file.

    regards, tom lane

Related Discussions

Discussion Navigation
viewthread | post

2 users in discussion

Tom Lane: 1 post Doug Kyle: 1 post