Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id E34BD9FB27F for ; Mon, 13 Nov 2006 13:43:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 29297-05 for ; Mon, 13 Nov 2006 17:43:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from fep05.ttnet.net.tr (mail.ttnet.net.tr [212.175.13.129]) by postgresql.org (Postfix) with ESMTP id E1A6C9F9F0A for ; Mon, 13 Nov 2006 13:43:00 -0400 (AST) Received: from (unknown) by AVGW-I-1.ttnet.net.tr with smtp id 241d_67a7d9f6_733e_11db_8772_001422175f0e; Mon, 13 Nov 2006 19:43:00 +0200 Received: from alamut ([85.97.155.105]) by fep05.ttnet.net.tr with ESMTP id <20061113174254.ZLRI10864.fep05.ttnet.net.tr@alamut>; Mon, 13 Nov 2006 19:42:54 +0200 Received: from (dsl.dynamic8597155105.ttnet.net.tr [85.97.155.105]) by AVGW-I-6.ttnet.net.tr with smtp id 2c77_63e9551a_733e_11db_8e62_0011433771ac; Mon, 13 Nov 2006 19:42:53 +0200 Date: Mon, 13 Nov 2006 19:41:39 +0200 From: Volkan YAZICI To: ivan marchesini Cc: pgsql-sql@postgresql.org Subject: Re: drop a check Message-ID: <20061113174138.GB1403@alamut> References: <1163435526.6395.27.camel@geoivan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1163435526.6395.27.camel@geoivan> User-Agent: Mutt/1.4.2.1i X-NAI-Spam-Rules: 0 Rules triggered X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.356 tagged_above=0 required=5 tests=BAYES_50, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: *** X-Archive-Number: 200611/137 X-Sequence-Number: 26789 On Nov 13 05:32, ivan marchesini wrote: > 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??? > with names is simple > > alter table tablename drop constraint constraintname; > > but without name?? :-) CREATE TABLE cons_test ( u integer CHECK (u > 10) ); SELECT constraint_name FROM information_schema.constraint_column_usage WHERE table_name = 'cons_test' AND column_name = 'u'; See infoschema-constraint-column-usage.html in the manual for further assistance. Regards.