Re: Table/Column Constraints - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Table/Column Constraints
Date
Msg-id 3A1956C4.D68807C7@tm.ee
Whole thread Raw
In response to Table/Column Constraints  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: Table/Column Constraints  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
List pgsql-hackers
Tom Lane wrote:
> 
> "Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> > * I assume that the command is supposed to allow the dropping of unique,
> > primary, foreign key and check constraints?  Should 'not null' constraints
> > also be included here?
> 
> Sure.
> 
> > * Unique constraints are implemented as indicies, so dropping a unique
> > constraint maps to dropping the relevant index.
> 
> Or just marking the index non-unique.  Dropping it altogether might be
> bad for query performance.

It also may break the db (make it impossible to update) if some FK
constraints are using it

> > Also - is there some good reason why this hasn't been implemented yet?  Is
> > there some subtle reason, or is it just that no-one's bothered?
> 
> I think no one's got round to it; attention has focused on DROP COLUMN,
> which is a great deal harder.  If you feel like working on DROP
> CONSTRAINT, go for it...

Dumping constraints in human-readable form (instead of CREATE CONSTRAIN
TRIGGER) would also be great.

---------
Hannu


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pl/pgsql slowness
Next
From: Hannu Krosing
Date:
Subject: Re: pl/pgsql slowness