Обсуждение: drop check constraint

Поиск
Список
Период
Сортировка

drop check constraint

От
"Tamsin"
Дата:
Hello,

Is it possible to drop a check constraint in any way without
dropping/recreating the table?  I've managed to drop foreign key constraints
by dropping the associated triggers, but check constraints don't seem to
create triggers and there isn't an alter table drop constraint command.  Is
there something I can do to the system tables?

(PostgreSQL 7.0.2)

Thanks for any ideas,
Tamsin


Re: drop check constraint

От
Stephan Szabo
Дата:
Yes.  You need to remove the row on pg_relcheck and then change the
value of relchecks for the row in pg_class for the relation the check
constraint is on.

On Wed, 7 Feb 2001, Tamsin wrote:

> Hello,
>
> Is it possible to drop a check constraint in any way without
> dropping/recreating the table?  I've managed to drop foreign key constraints
> by dropping the associated triggers, but check constraints don't seem to
> create triggers and there isn't an alter table drop constraint command.  Is
> there something I can do to the system tables?