Thread: ALTER TABLE ADD CHECK ...

ALTER TABLE ADD CHECK ...

From
Stephan Szabo
Date:
Here's a beginning to ALTER TABLE ADD CONSTRAINT
for check constraints and some misc fixes (1 of which is
important).  It's a fairly minimal beginning that seems
to work on constraints i could put into the table at
create time.

The important fix is that it adds a pg_ownercheck to
the beginning to prevent random people from adding
constraints to tables they don't own.  I had thought
that would have been checked earlier, but I missed the
comment on alter table in that piece of code.

It also fixes a stupid little error that causes adding
a foreign key to give the wrong constraint name if one
is specified and the constraint fails on the current data.

Attachment