Re: rename idx's with table; avoid confusing idx names? - Mailing list pgsql-sql

From Tom Lane
Subject Re: rename idx's with table; avoid confusing idx names?
Date
Msg-id 8277.1133562824@sss.pgh.pa.us
Whole thread Raw
In response to rename idx's with table; avoid confusing idx names?  (george young <gry@ll.mit.edu>)
List pgsql-sql
george young <gry@ll.mit.edu> writes:
> I put together a plpgsql function to rename a table and it's indexes
> correspondingly[see below].  I would like to know:

>   Is there a more robust/portable/clear way to do this?
>   Is this a bad idea for some subtle reason?

It won't work if the table and column names are so long as to require
truncation to form an index name.  Also there are some corner cases
in which you'll collide with existing index names.  (The underlying
backend index-name creation logic goes to some effort to generate
nonconflicting index names, but this code isn't doing any such thing.)
        regards, tom lane


pgsql-sql by date:

Previous
From: george young
Date:
Subject: rename idx's with table; avoid confusing idx names?
Next
From: "James M Doherty"
Date:
Subject: Re: Quote_literal()