Hi folks

Somehow we've ended up with a few corrupt indices in our database. We've
previously dropped the table they were on, but the indices are still there
(kind of):


Trying to drop the indices gives us:

drop index "v_0000038e_GEOMETRY";

ERROR:  could not open relation with OID 9590980



Looking up that index in pg_class:

select oid, relname from pg_class where relname = 'v_0000038e_GEOMETRY';

   oid   |       relname

---------+---------------------

 9590993 | v_0000038e_GEOMETRY



And looking up those OIDs in pg_depend:

select * from pg_depend where objid = 9590993;

 classid |  objid  | objsubid | refclassid | refobjid | refobjsubid |
> deptype

---------+---------+----------+------------+----------+-------------+---------

    1259 | 9590993 |        0 |       1259 |  9590980 |           3 | a

    1259 | 9590993 |        0 |       2616 |    20506 |           0 | n



But that table doesn't exist anymore (that's okay, we dropped it earlier):

select * from pg_class where oid = 9590980 or relname = 'v_0000038e';

(0 rows)



Restarting the database didn't help, unfortunately.

I'm a bit hesitant to try the fix mentioned at the following URL since it
involves deleting things from system tables:
http://javadave.blogspot.com/2005/06/could-not-open-relation-in-postgresql.html


Any suggestions for a nicer approach? Or can someone who knows tell me if
its okay to follow the instructions at that url, without breaking anything?

Thanks

Craig de Stigter

-- 
Koordinates Ltd
PO Box 1604, Shortland St, Auckland, New Zealand
Phone +64-9-966 0433 Fax +64-9-969 0045
Web http://www.koordinates.com

Reply via email to