pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Volkan YAZICI <yazicivo@ttnet.net.tr>
To: ivan marchesini <marchesini@unipg.it>
Cc: pgsql-sql@postgresql.org
Subject: Re: drop a check
Date: Mon, 13 Nov 2006 19:41:39 +0200
Message-ID: <20061113174138.GB1403@alamut> (raw)
In-Reply-To: <1163435526.6395.27.camel@geoivan>
References: <1163435526.6395.27.camel@geoivan>

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.



view thread (7+ messages)  latest in thread

Message-ID: <20061113174138.GB1403@alamut>
Permalink:  ../20061113174138.GB1403@alamut/
Also on:    postgresql.org/message-id/20061113174138.GB1403@alamut

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: yazicivo@ttnet.net.tr, marchesini@unipg.it
  Subject: Re: drop a check
  In-Reply-To: <20061113174138.GB1403@alamut>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox