dump error parent table oid of pg_rewrite entry oid not found

From: Doug Kyle <dkyle(at)grpl(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: dump error parent table oid of pg_rewrite entry oid not found
Date: 2010-04-07 20:21:36
Message-ID: 4BBCE950.9070402@grpl.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tuo Pe 2010-04-07 20:28:04 Re: Problem either with PostgreSQL or with PHP (SOLVED!)
Previous Message Vick Khera 2010-04-07 19:27:02 Re: Solid State Drives with PG