Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 219B79FA3C0 for ; Mon, 13 Nov 2006 14:59:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 51504-06 for ; Mon, 13 Nov 2006 14:59:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from trabant.cianoz.org (host31-194-149-62.serverdedicati.aruba.it [62.149.194.31]) by postgresql.org (Postfix) with ESMTP id A92AE9FA217 for ; Mon, 13 Nov 2006 14:59:40 -0400 (AST) Received: by trabant.cianoz.org (Postfix, from userid 1031) id AE0C5384183; Mon, 13 Nov 2006 19:59:39 +0100 (CET) Received: from geologia5.agora.ing.unipg.it (geologia5.agora.ing.unipg.it [141.250.41.212]) by trabant.cianoz.org (Postfix) with ESMTP id B95F3384044; Mon, 13 Nov 2006 19:59:32 +0100 (CET) Subject: Re: drop a check From: ivan marchesini Reply-To: marchesini@unipg.it To: Volkan YAZICI Cc: pgsql-sql@postgresql.org In-Reply-To: <20061113174138.GB1403@alamut> References: <1163435526.6395.27.camel@geoivan> <20061113174138.GB1403@alamut> Content-Type: text/plain Organization: University of Perugia Date: Mon, 13 Nov 2006 18:48:33 +0100 Message-Id: <1163440113.15503.18.camel@geoivan> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80 (http://www.clamav.net) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/143 X-Sequence-Number: 26795 ..... or it depend on the fact I'm using postgres 7.4.13 many thanks... Ivan On lun, 2006-11-13 at 19:41 +0200, Volkan YAZICI wrote: > 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. > -- Ivan Marchesini Department of Civil and Environmental Engineering University of Perugia Via G. Duranti 93/a 06125 Perugia (Italy) e-mail: marchesini@unipg.it ivan.marchesini@gmail.com tel: +39(0)755853760 fax: +39(0)755853756 jabber: geoivan73@jabber.org