Re: DROP CONSTRAINT (UNIQUE) preliminary support

Lists: Postg토토 커뮤니티SQL
From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Patches" <pgsql-patches(at)postgresql(dot)org>
Subject: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-05-31 11:03:06
Message-ID: ECEHIKNFIMMECLEBJFIGAENICAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hi all,

This patch allows ALTER TABLE/DROP CONSTRAINT to drop UNIQUE constraints by
dropping the relevant index.

This is a prelim patch that I need comment on (The @@ comments), and I've
edited some things out by hand, so I don't recommend applying it to anything
just yet.

I have added an IsIndex function to indexcmds.c and a RemoveUniqueConstraint
to heap.c, plus modified command.c's AlterTableDropConstraint function to
call RemoveUniqueConstraint.

Note that I have disabled inheritance support for unique constraints - since
it's impossible to have two indices of the same name anyway...

Comments please.

Chris

Attachment Content-Type Size
unique.diff application/octet-stream 9.4 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-06-12 17:37:39
Message-ID: 200106121737.f5CHbdC25410@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


How are we doing on this patch?

> Hi all,
>
> This patch allows ALTER TABLE/DROP CONSTRAINT to drop UNIQUE constraints by
> dropping the relevant index.
>
> This is a prelim patch that I need comment on (The @@ comments), and I've
> edited some things out by hand, so I don't recommend applying it to anything
> just yet.
>
> I have added an IsIndex function to indexcmds.c and a RemoveUniqueConstraint
> to heap.c, plus modified command.c's AlterTableDropConstraint function to
> call RemoveUniqueConstraint.
>
> Note that I have disabled inheritance support for unique constraints - since
> it's impossible to have two indices of the same name anyway...
>
> Comments please.
>
> Chris

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Patches" <pgsql-patches(at)postgresql(dot)org>
Subject: RE: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-06-13 01:49:35
Message-ID: ECEHIKNFIMMECLEBJFIGGEPECAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

> How are we doing on this patch?

Don't commit it! I just want feedback - however I prolly won't worry about
it until I've finished fully implementing DROP CONSTRAINT to support all
types of constraints.

> > Hi all,
> >
> > This patch allows ALTER TABLE/DROP CONSTRAINT to drop UNIQUE
> constraints by
> > dropping the relevant index.
> >
> > This is a prelim patch that I need comment on (The @@
> comments), and I've
> > edited some things out by hand, so I don't recommend applying
> it to anything
> > just yet.
> >
> > I have added an IsIndex function to indexcmds.c and a
> RemoveUniqueConstraint
> > to heap.c, plus modified command.c's AlterTableDropConstraint
> function to
> > call RemoveUniqueConstraint.
> >
> > Note that I have disabled inheritance support for unique
> constraints - since
> > it's impossible to have two indices of the same name anyway...
> >
> > Comments please.
> >
> > Chris
>
> [ Attachment, skipping... ]
>
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
> + If your life is a hard drive, | 830 Blythe Avenue
> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
>


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-06-13 01:55:59
Message-ID: 200106130155.f5D1txD18891@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg토토 커뮤니티SQL

> > How are we doing on this patch?
>
> Don't commit it! I just want feedback - however I prolly won't worry about
> it until I've finished fully implementing DROP CONSTRAINT to support all
> types of constraints.

I haven't seen anyone comment on it so I asked.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-07-09 18:45:04
Message-ID: 200107091845.f69Ij4a09490@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Christopher, where are we on this patch?

> Hi all,
>
> This patch allows ALTER TABLE/DROP CONSTRAINT to drop UNIQUE constraints by
> dropping the relevant index.
>
> This is a prelim patch that I need comment on (The @@ comments), and I've
> edited some things out by hand, so I don't recommend applying it to anything
> just yet.
>
> I have added an IsIndex function to indexcmds.c and a RemoveUniqueConstraint
> to heap.c, plus modified command.c's AlterTableDropConstraint function to
> call RemoveUniqueConstraint.
>
> Note that I have disabled inheritance support for unique constraints - since
> it's impossible to have two indices of the same name anyway...
>
> Comments please.
>
> Chris

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Patches" <pgsql-patches(at)postgresql(dot)org>
Subject: RE: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-07-10 01:30:51
Message-ID: ECEHIKNFIMMECLEBJFIGCEDJCBAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

> Christopher, where are we on this patch?

No-one commented on it. It's not a committable patch, it was basically to
get some feedback to see if I was going in the right direction.

Since then, I decided to complete the ADD CONSTRAINT stuff first. I've
_almost_ finished ADD UNIQUE and ADD PRIMARY. I'll probably submit a patch
for those in the next couple of days. After that I'll worry about DROP
CONSTRAINT again.

Chris

> > Hi all,
> >
> > This patch allows ALTER TABLE/DROP CONSTRAINT to drop UNIQUE
> constraints by
> > dropping the relevant index.
> >
> > This is a prelim patch that I need comment on (The @@
> comments), and I've
> > edited some things out by hand, so I don't recommend applying
> it to anything
> > just yet.
> >
> > I have added an IsIndex function to indexcmds.c and a
> RemoveUniqueConstraint
> > to heap.c, plus modified command.c's AlterTableDropConstraint
> function to
> > call RemoveUniqueConstraint.
> >
> > Note that I have disabled inheritance support for unique
> constraints - since
> > it's impossible to have two indices of the same name anyway...
> >
> > Comments please.
> >
> > Chris
>
> [ Attachment, skipping... ]
>
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
> + If your life is a hard drive, | 830 Blythe Avenue
> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
>


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-07-10 01:57:24
Message-ID: 200107100157.f6A1vO510336@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

> > Christopher, where are we on this patch?
>
> No-one commented on it. It's not a committable patch, it was basically to
> get some feedback to see if I was going in the right direction.
>
> Since then, I decided to complete the ADD CONSTRAINT stuff first. I've
> _almost_ finished ADD UNIQUE and ADD PRIMARY. I'll probably submit a patch
> for those in the next couple of days. After that I'll worry about DROP
> CONSTRAINT again.

Oh, fine. Just checking. Didn't want you to think we weren't
interested in your work.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Patches" <pgsql-patches(at)postgresql(dot)org>
Subject: RE: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-07-10 01:59:54
Message-ID: ECEHIKNFIMMECLEBJFIGMEDJCBAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

> > Since then, I decided to complete the ADD CONSTRAINT stuff first. I've
> > _almost_ finished ADD UNIQUE and ADD PRIMARY. I'll probably
> submit a patch
> > for those in the next couple of days. After that I'll worry about DROP
> > CONSTRAINT again.
>
> Oh, fine. Just checking. Didn't want you to think we weren't
> interested in your work.

Well - it isn't as sexy as UNDO/REDO support, planner optimisation or an
overwriting storage manager, but there's nothing more annoying to me as a
web developer to have inflexible schema. How much do I want that DROP
COLUMN feature! It's simply not feasible to recreate the table without the
column on a live server.

Chris


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-07-10 02:06:50
Message-ID: 200107100206.f6A26oO11952@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

> > > Since then, I decided to complete the ADD CONSTRAINT stuff first. I've
> > > _almost_ finished ADD UNIQUE and ADD PRIMARY. I'll probably
> > submit a patch
> > > for those in the next couple of days. After that I'll worry about DROP
> > > CONSTRAINT again.
> >
> > Oh, fine. Just checking. Didn't want you to think we weren't
> > interested in your work.
>
> Well - it isn't as sexy as UNDO/REDO support, planner optimisation or an
> overwriting storage manager, but there's nothing more annoying to me as a
> web developer to have inflexible schema. How much do I want that DROP
> COLUMN feature! It's simply not feasible to recreate the table without the
> column on a live server.

Agreed. We need to bite the bullet, decide on a plan, and get going.
My vote is to make a second copy of the table then update pg_class. Now
that we have files as numbers, relfilenode, we can do that reliably.
Let's get started!

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-08-24 17:35:28
Message-ID: 200108241735.f7OHZSu09182@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Where did we leave this?

> Hi all,
>
> This patch allows ALTER TABLE/DROP CONSTRAINT to drop UNIQUE constraints by
> dropping the relevant index.
>
> This is a prelim patch that I need comment on (The @@ comments), and I've
> edited some things out by hand, so I don't recommend applying it to anything
> just yet.
>
> I have added an IsIndex function to indexcmds.c and a RemoveUniqueConstraint
> to heap.c, plus modified command.c's AlterTableDropConstraint function to
> call RemoveUniqueConstraint.
>
> Note that I have disabled inheritance support for unique constraints - since
> it's impossible to have two indices of the same name anyway...
>
> Comments please.
>
> Chris

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Patches" <pgsql-patches(at)postgresql(dot)org>
Subject: RE: DROP CONSTRAINT (UNIQUE) preliminary support
Date: 2001-08-25 03:08:12
Message-ID: ECEHIKNFIMMECLEBJFIGGEKHCBAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Forget this patch entirely - it was just a preview so I could get comment.
But then I got bored and decided to implement ADD UNIQUE and ADD PRIMARY
before worrying about the DROP code.

Discard it - I'll resubmit a proper patch some other time.

Chris

> -----Original Message-----
> From: Bruce Momjian [mailto:pgman(at)candle(dot)pha(dot)pa(dot)us]
> Sent: Saturday, 25 August 2001 1:35 AM
> To: Christopher Kings-Lynne
> Cc: Patches
> Subject: Re: [PATCHES] DROP CONSTRAINT (UNIQUE) preliminary support
>
>
>
> Where did we leave this?
>
> > Hi all,
> >
> > This patch allows ALTER TABLE/DROP CONSTRAINT to drop UNIQUE
> constraints by
> > dropping the relevant index.
> >
> > This is a prelim patch that I need comment on (The @@
> comments), and I've
> > edited some things out by hand, so I don't recommend applying
> it to anything
> > just yet.
> >
> > I have added an IsIndex function to indexcmds.c and a
> RemoveUniqueConstraint
> > to heap.c, plus modified command.c's AlterTableDropConstraint
> function to
> > call RemoveUniqueConstraint.
> >
> > Note that I have disabled inheritance support for unique
> constraints - since
> > it's impossible to have two indices of the same name anyway...
> >
> > Comments please.
> >
> > Chris
>
> [ Attachment, skipping... ]
>
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
> + If your life is a hard drive, | 830 Blythe Avenue
> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
>