Drop CHECK Constraint

From: Yan Cheng CHEOK <yccheok(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Drop CHECK Constraint
Date: 2011-02-21 09:39:10
Message-ID: 254602.16528.qm@web65703.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was wondering, is there any good way to drop a constraint? Currently, I am making assumption on the check constraint name.

Although it works at current moment, I do not feel comfortable with it in long run.

For example :

ALTER TABLE backup_table ADD CHECK (fk_lot_id = 99);

If I want to drop the above CHECK constraint, I will do

ALTER TABLE backup_table DROP CONSTRAINT backup_table_fk_lot_id_check; (I assume the constraint name will be backup_table_fk_lot_id_check)

Is there any more robust way?

Thanks and Regards
Yan Cheng CHEOK

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christian Ullrich 2011-02-21 10:32:34 Re: Drop CHECK Constraint
Previous Message John R Pierce 2011-02-21 08:54:51 Re: 回复: [GENERAL] How to make the user-defined function or type beingaccessed in the global database server?