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 22849.1218389336@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately
Re: ALTER TABLE name RENAME TO new_name; does notworkimmediately
List pgsql-bugs
Gregory Stark <stark@enterprisedb.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

pgsql-bugs by date:

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