pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-sql@postgresql.org
Subject: Re: drop a check
Date: Mon, 13 Nov 2006 19:34:01 +0100
Message-ID: <20061113183401.GA31078@KanotixBox> (raw)
In-Reply-To: <1163435526.6395.27.camel@geoivan>
References: <1163435526.6395.27.camel@geoivan>

ivan marchesini <marchesini@unipg.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°



view thread (7+ messages)  latest in thread

Message-ID: <20061113183401.GA31078@KanotixBox>
Permalink:  ../20061113183401.GA31078@KanotixBox/
Also on:    postgresql.org/message-id/20061113183401.GA31078@KanotixBox

 · 

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: akretschmer@spamfence.net
  Subject: Re: drop a check
  In-Reply-To: <20061113183401.GA31078@KanotixBox>

* 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