From: | Stephen Frost <sfrost(at)snowman(dot)net> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: Index name different from constraint name |
Date: | 2005-10-26 16:14:57 |
Message-ID: | 20051026161457.GU6026@ns.snowman.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> Stephen Frost <sfrost(at)snowman(dot)net> writes:
> > test=> create table a (
> > test(> b int primary key
> > test(> );
> > NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "a_pkey" for=
> > table "a"
> > CREATE TABLE
> > test=> alter table a rename to c;
> > ALTER TABLE
> > test=> alter index a_pkey rename to c_pkey;
> > ALTER INDEX
>
> Arguably we should forbid ALTER INDEX RENAME on an index that belongs to
> a constraint, and make you rename the constraint instead (and have that
> implicitly change the index name too).
That would work too, though I don't think you can just rename a
constraint. You have to drop/add it, which means dropping and then
adding the index back it looks like, which kind of sucks if it's a big
table (one reason I wasn't just dropping/recreating the table in the
first place). This was on 8.0.3; can you rename constraints w/ 8.1? If
so, and if that's made to implicitly change the index name, I'd be
happy.
Thanks,
Stephen
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2005-10-26 16:30:04 | Re: Index name different from constraint name |
Previous Message | Telin Lin | 2005-10-26 15:44:38 | Re: BUG #2001: Signal 11 after concurrent inserts + updates |