Sunday, August 10, 2008

Re: [BUGS] ALTER TABLE name RENAME TO new_name; does notworkimmediately

"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> 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.

Yeah, doing the equivalent of this in gdb seems to fix it (haven't rebuilt yet
to test that I haven't done something silly in the C code though)


--- index.c 30 Jul 2008 21:56:59 +0100 1.300
+++ index.c 10 Aug 2008 19:55:21 +0100
@@ -2382,6 +2382,11 @@
is_pg_class = (RelationGetRelid(rel) == RelationRelationId);
doneIndexes = NIL;

+ /* have to build the HOT indexed column bitmap before we start lying about
+ * what indexes exist... */
+ if (is_pg_class && !rel->rd_indexattr)
+ (void)RelationGetIndexAttrBitmap(rel);
+
/* Reindex all the indexes. */
foreach(indexId, indexIds)
{


--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

No comments: