Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 9D6D59FBB29 for ; Mon, 13 Nov 2006 14:55:17 -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 57092-01-3 for ; Mon, 13 Nov 2006 18:54:50 +0000 (UTC) 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 C65F99FB28C for ; Mon, 13 Nov 2006 14:38:17 -0400 (AST) Received: by trabant.cianoz.org (Postfix, from userid 1031) id D6A24384030; Mon, 13 Nov 2006 19:38:16 +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 264FC38401B; Mon, 13 Nov 2006 19:38:11 +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:38:27 +0100 Message-Id: <1163439507.15503.15.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/142 X-Sequence-Number: 26794 Dear Volkan, thank you for your answer... I have tried to verify the table information_schema.constraint_column_usage, but, and I was really surprised, I have found nothing inside it.. it seems there are not checks!!! I have also seen the manual page you suggested but I can't understand why I don't have checks in this table... but I'm sure I have checks in my table.. because they works!!!!! does this problem can be related to the fact that I have created the checks only after that I have created the table... I have used this syntacs: alter table tablename add check (......) however it sounds strange!!!!! 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