Re: Doc patch: Document names of automatically created constraints and indexes - Mailing list pgsql-hackers

From Karl O. Pinc
Subject Re: Doc patch: Document names of automatically created constraints and indexes
Date
Msg-id 1353556811.9472.0@mofo
Whole thread Raw
In response to Re: Doc patch: Document names of automatically created constraints and indexes  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Doc patch: Document names of automatically created constraints and indexes
List 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@gmx.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@meme.com>
Free Software:  "You don't pay back, you pay forward."                -- Robert A. Heinlein




pgsql-hackers by date:

Previous
From: "Karl O. Pinc"
Date:
Subject: Re: User control over psql error stream
Next
From: Andrew Dunstan
Date:
Subject: Re: WIP json generation enhancements