From: Tom Lane <tgl@sss.pgh.pa.us>
To: gry@ll.mit.edu
Cc: pgsql-sql@postgresql.org
Subject: Re: rename idx's with table; avoid confusing idx names?
Date: Fri, 02 Dec 2005 17:33:44 -0500
Message-ID: <8277.1133562824@sss.pgh.pa.us> (raw)
In-Reply-To: <20051202130037.38a45fbf.gry@ll.mit.edu>
References: <20051202130037.38a45fbf.gry@ll.mit.edu>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, gry@ll.mit.edu
Subject: Re: rename idx's with table; avoid confusing idx names?
In-Reply-To: <8277.1133562824@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox