Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
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 17:28:56
Message-ID: 22849.1218389336@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> On the other hand the problem does not occur if the CREATE TABLE is in the
> same session. Nor if the REINDEX DATABASE is skipped.

It appears that you have to do the RENAME TABLE in the same session as
the REINDEX DATABASE. Furthermore, the failure then persists into
subsequent sessions. There is a "yyy" entry in pg_class, but index
searches using pg_class_relname_nsp_index don't find it.

Also, I can still reproduce it with just REINDEX TABLE pg_class instead
of REINDEX DATABASE.

What I suspect is we've broken the logic that manages REINDEX applied to
pg_class itself. There's a mighty delicate dance that goes on there,
and we haven't tested it too much lately.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2008-08-10 18:03:34 Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately
Previous Message Gregory Stark 2008-08-10 09:34:42 Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately