pgsql: Remove code that attempted to rename index columns to keep them

Lists: pgsql-committerspgsql-hackers
From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove code that attempted to rename index columns to keep them
Date: 2009-12-23 16:43:44
Message-ID: 20091223164344.25703753FB7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Log Message:
-----------
Remove code that attempted to rename index columns to keep them in sync with
their underlying table columns. That code was not bright enough to cope with
collision situations (ie, new name conflicts with some other column of the
index). Since there is no functional reason to do this at all, trying to
upgrade the logic to be bulletproof doesn't seem worth the trouble.

This change means that both the index name and the column names of an index
are set when it's created, and won't be automatically changed when the
underlying table columns are renamed. Neatnik DBAs are still free to rename
them manually, of course.

Modified Files:
--------------
pgsql/src/backend/commands:
tablecmds.c (r1.310 -> r1.311)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c?r1=1.310&r2=1.311)


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Remove code that attempted to rename index columns to keep them
Date: 2009-12-23 16:52:46
Message-ID: 200912231652.nBNGqkt07644@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Log Message:
> -----------
> Remove code that attempted to rename index columns to keep them in sync with
> their underlying table columns. That code was not bright enough to cope with
> collision situations (ie, new name conflicts with some other column of the
> index). Since there is no functional reason to do this at all, trying to
> upgrade the logic to be bulletproof doesn't seem worth the trouble.
>
> This change means that both the index name and the column names of an index
> are set when it's created, and won't be automatically changed when the
> underlying table columns are renamed. Neatnik DBAs are still free to rename
> them manually, of course.

Does this mean this TODO items should be modified to remove the index
name mention?

Add ALTER TABLE RENAME CONSTRAINT, update index name also

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Remove code that attempted to rename index columns to keep them
Date: 2009-12-23 17:10:37
Message-ID: 5205.1261588237@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Does this mean this TODO items should be modified to remove the index
> name mention?

> Add ALTER TABLE RENAME CONSTRAINT, update index name also

No, that has nothing to do with this.

We already have ALTER INDEX renaming the associated constraint, so
I'm not sure how important the TODO item really is. But if someone
were to do it, we'd certainly want the other direction to keep them
in sync too.

regards, tom lane