| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Greg Stark <gsstark(at)mit(dot)edu> | 
| Cc: | Hannu Krosing <hannu(at)skype(dot)net>, Zeugswetter Andreas DCP SD <ZeugswetterA(at)spardat(dot)at>, pgsql-hackers(at)postgresql(dot)org | 
| Subject: | Re: ADD/DROP INHERITS | 
| Date: | 2006-06-08 15:48:57 | 
| Message-ID: | 28127.1149781737@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Greg Stark <gsstark(at)mit(dot)edu> writes:
> Come to think of it it's pretty strange that you can drop an inherited
> constraint from a child. And doing an experiment it seems you can also DROP
> NOT NULL on a child which is also pretty strange.
Yeah. I think we had agreed that this is a bug. Note the TODO entries:
	o Prevent parent tables from altering or dropping constraints
	  like CHECK that are inherited by child tables unless CASCADE
	  is used
	o %Prevent child tables from altering or dropping constraints
          like CHECK that were inherited from the parent table
> I don't see how to block these operations though unless we either search
> parent classes for constraints to check at run-time or add additional
> dependency records to block dropping these things.
The implementation I had in mind was to add columns similar to attinhcount
and attislocal to pg_constraint.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jim C. Nasby | 2006-06-08 15:50:33 | Type of bare text strings | 
| Previous Message | David Fetter | 2006-06-08 15:47:24 | Re: [HACKERS] drop if exists remainder |