From: | Andreas Kretschmer <akretschmer(at)spamfence(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: drop a check |
Date: | 2006-11-13 18:34:01 |
Message-ID: | 20061113183401.GA31078@KanotixBox |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
ivan marchesini <marchesini(at)unipg(dot)it> schrieb:
> Dear all...
> I have created a check constraint without giving it a name..
> now I have a check named "$25" in my table that I need to drop or
> modify!!!
> How can I do???
Can you see the name with \d <table> within psql?
An example:
test=# create table bla (id int check (id between 1 and 4));
CREATE TABLE
test=# \d bla
Table "public.bla"
Column | Type | Modifiers
--------+---------+-----------
id | integer |
Check constraints:
"bla_id_check" CHECK (id >= 1 AND id <= 4)
test=# alter table bla drop CONSTRAINT bla_id_check;
ALTER TABLE
test=# \d bla
Table "public.bla"
Column | Type | Modifiers
--------+---------+-----------
id | integer |
HTH, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknow)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°
From | Date | Subject | |
---|---|---|---|
Next Message | Volkan YAZICI | 2006-11-13 19:01:53 | Re: drop a check |
Previous Message | Rodrigo Sakai | 2006-11-13 18:33:40 | Another question about composite types |