"Alex Hunsaker" <badalex@gmail.com> writes:
> On Wed, Feb 20, 2008 at 3:55 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Actually the bug is that ALTER TABLE allows you to do that. It should
>> not be possible to drop an inherited constraint, but right now there's
>> not enough information in the system catalogs to detect the situation.
>> Fixing this has been on the TODO list for awhile:
> Hrm how about something like the attached patch?
It seems much more restrictive than necessary, plus it does nothing
for the check-constraint case. My recollection of the previous
discussion about how to fix this was that we needed to add an inhcount
column to pg_constraint, and add entries for not-null constraints (at
least inherited ones) to pg_constraint so that they'd be able to have
inhcount fields. The latter would also allow us to attach names to
not-null constraints, which I think is required by spec but we've never
supported.
regards, tom lane