Am Mittwoch, 20. November 2002 20:09 schrieb RenX SalomXo:
> Does anybody could tell me how to drop a constraint on a column where no
> name was provided to the constraint? How does Pg name constraints?
>
> Thanks
did you add a "CHECK" constraint, or did you use "NOT NULL" in the table definition? For the not null case it's easy:
update pg_attribute
set attnotnull=false
where attname='yourattributename'
and attrelid=(select oid from pg_class where relname='mytable' and relkind='r');
If you added a check constraint, you have to remove the corresponding row from pg_relcheck
and decrement the attribute "relchecks" in pg_class for the table, but I won't do it without having
a backup at hand.
Backup your data first.
Regards,
Mario Weilguni