Re: rename idx's with table; avoid confusing idx names?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: gry(at)ll(dot)mit(dot)edu
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: rename idx's with table; avoid confusing idx names?
Date: 2005-12-02 22:33:44
Message-ID: 8277.1133562824@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

george young <gry(at)ll(dot)mit(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message James M Doherty 2005-12-03 13:57:33 Re: Quote_literal()
Previous Message george young 2005-12-02 18:00:37 rename idx's with table; avoid confusing idx names?