Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, <megous(at)gmail(dot)com>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately
Date: 2008-08-10 18:56:32
Message-ID: 87hc9sd7hb.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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!

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2008-08-11 00:49:50 Re: BUG #3818: Cross compilation problems
Previous Message Tom Lane 2008-08-10 18:50:59 Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately