Re: Setting a pre-existing index as a primary key

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting a pre-existing index as a primary key
Date: 2008-05-12 16:17:34
Message-ID: 200805121617.m4CGHYr06026@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joshua D. Drake wrote:
> Tom Lane wrote:
>
> >> Well it should be optional but it would be nice if we had the option to
> >> have it renamed per the default... meaning the same output if I were to
> >> do this:
> >
> > If you want that, you can rename the index (either before or afterwards).
> > I don't see any reason to clutter the make-constraint-from-index command
> > with questions of renaming.
>
> As a counter point, I don't see any reason to make the DBA's life
> harder. Sure it is just one step but it is a human step, prone to error
> and taking more time than it should. Why not just make it easy?
> Especially when the easy isn't sacrificing data integrity or quality of
> product?

I realize most feel we don't need to add a rename to this, but there are
two more reasons _not_ to do this. First, there is the possibility of
name collision with the new name so you would then require the user to
use the option not to rename. Plus, if you renamed, the old index name
would go away, and some people might think the index was removed and not
realize it was renamed, or find it confusing it was renamed.

--
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. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2008-05-12 16:32:31 Re: ecpg crash
Previous Message Alvaro Herrera 2008-05-12 16:13:50 Re: bloated heapam.h