Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately - Mailing list pgsql-bugs

From Tom Lane
Subject Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately
Date
Msg-id 23406.1218391414@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately
List pgsql-bugs
I wrote:
> What I suspect is we've broken the logic that manages REINDEX applied to
> pg_class itself.

Hm, this is a HOT bug.  (Unless the OP found it on something older
than 8.3, in which case we might have more than one issue involved.)
What I'm seeing is that when heap_update checks to see if the new
pg_class tuple is HOT-updatable, RelationGetIndexAttrBitmap tells it
that only the OID is an indexed attribute, and so it does a HOT update,
leaving the wrong index entry in place.

Apparently, rd_indexattr needs to get cleared someplace where it
isn't being cleared right now.  I'm sure this is related to the
fancy dance we do for pg_class reindexing, but not sure yet where
to fix it.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately
Next
From: Gregory Stark
Date:
Subject: Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately