Thread: index file detached from data file

index file detached from data file

From
Jeff Hoffmann
Date:
I have a server running 7.4 that has an index file that's kind of 
floating in limbo, not attached to anything.  When I try to drop it, I 
get the following:

ERROR:  could not open relation with OID 2293160133

The OID of the table that it should be attached to is 2300667425, so it 
might still think it's attached to an old copy of that table -- that 
table has been dropped and subsequently restored from a backup, which is 
how I found out there was a problem.  The backup was trying to create an 
index with the same name that the "limbo" index had, which caused an 
error.  The index still shows up in pg_class and its file still exists, 
it's just not attached to anything.

My most immediate concern is how can I safely clean up this entry for 
the index?  Also, is it really possible to drop a table while it's being 
indexed or otherwise used to cause a situation like this?  Or am I 
misreading what probably happened?

-- 
Jeff Hoffmann
jeff@propertykey.com