Renaming tables and their indexes simultaneously - Mailing list pgsql-general

From Moshe Jacobson
Subject Renaming tables and their indexes simultaneously
Date
Msg-id CAJ4CxLn5LivrdLa7rZUrZxD0RHJar=YWhuM5YMh2FMsZ4anSyw@mail.gmail.com
Whole thread Raw
Responses Re: Renaming tables and their indexes simultaneously
List pgsql-general
I have a stored procedure that renames a table as part of a partitioning scheme, then re-creates it.
Up until recently (I'm not sure what changed), renaming the table would cause the pkey index/constraint, as well as all other indexes, to be renamed according to the new table name.
However, they now do not rename, and cause collisions when the new table is created.

I would prefer not having to drop and re-create the primary key index, as it takes quite a while to drop and re-create an index that large.

How can I cause Postgres to rename the table's attached indexes when I rename the table, and what might have caused it to stop doing so recently?

We are on Postgres 9.1, but we did not recently upgrade...

Thanks.

--
Moshe Jacobson
Nead Werx, Inc. | Senior Systems Engineer
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
moshe@neadwerx.com | 
www.neadwerx.com

pgsql-general by date:

Previous
From: Wolfgang Keller
Date:
Subject: Re: Some thoughts on table inheritance (which is uniquely awesome on PostgreSQL)
Next
From: Jeff Janes
Date:
Subject: Re: 9.2 and index only scans