Re: Doc patch: Document names of automatically created constraints and indexes

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Doc patch: Document names of automatically created constraints and indexes
Date: 2012-11-22 04:00:11
Message-ID: 1353556811.9472.0@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/21/2012 02:12:26 PM, Robert Haas wrote:
> On Sat, Nov 17, 2012 at 1:22 AM, Peter Eisentraut <peter_e(at)gmx(dot)net>
> wrote:
> > On Mon, 2012-11-12 at 11:42 -0600, Karl O. Pinc wrote:
> >> Could ALTER TABLE use an option to drop the
> >> primary key constraint? I needed to do that,
> >> found it was not obvious, and this lead me to
> >> try to improve things.
> >
> > That could be useful, I think. But it might open a can of worms.
>
> Would the new option be syntactic sugar around ALTER TABLE ... DROP
> CONSTRAINT "put_the_name_of_the_primary_key_here"?

This sounds nice to me, but there's worms left over because
the unique index created when PRIMARY KEY is specified would
then remain. This the right behavior IMHO, and if everything
is spelled out in the documentation no problems should arise.

But the user deserves to know how to get rid of the unique
index too, so the index's name would need to be documented.
Since this is something of an internal matter (?) there
might be another worm here.

Regards,

Karl <kop(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-11-22 04:24:03 Re: WIP json generation enhancements
Previous Message Karl O. Pinc 2012-11-22 03:51:47 Re: User control over psql error stream