Skip site navigation (1) Skip section navigation (2)

Re: Fw: Removing foreign key and adding sequence

From: "Chad Thompson" <chad(at)weblinkservices(dot)com>
To: "Nabil Sayegh" <postgresql(at)e-trolley(dot)de>
Cc: "pgsql-novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Fw: Removing foreign key and adding sequence
Date: 2003-06-26 21:19:19
Message-ID: 002f01c33c28$9c54fe00$32021aac@chad (view raw or flat)
Thread:
Lists: pgsql-novice
> >  7.32.  Can I just drop the foreign key?  That would be SO much easier
:-)
>
> Since 7.3 it's very easy, but even with 7.2 you could:
>
> 7.3:
> \d table_name
> if the key is labeled with e.g. $1:
> ALTER TABLE table_name DROP CONSTRAINT "$1";
> >

Hrm... What could I be doing wrong?

db=# \d lists
                                    Table "public.lists"
      Column      |         Type          |                    Modifiers

------------------+-----------------------+---------------------------------
-----------------
 id               | bigint                | not null default
nextval('"lists_id_seq"'::text)
 first_name       | character varying(50) |
 middle_initial   | character(1)          |
 last_name        | character varying(30) |

[SNIP]

         lol_id_idx btree (list_of_lists_id)
Triggers: RI_ConstraintTrigger_10337839,
          RI_ConstraintTrigger_10337842,
          RI_ConstraintTrigger_10337860

db=# alter table lists drop constraint "RI_ConstraintTrigger_10337839";
ERROR:  ALTER TABLE / DROP CONSTRAINT: RI_ConstraintTrigger_10337839 does
not exist
db=# alter table lists drop constraint RI_ConstraintTrigger_10337839;
ERROR:  ALTER TABLE / DROP CONSTRAINT: ri_constrainttrigger_10337839 does
not exist


In response to

Responses

pgsql-novice by date

Next:From: Fontenot, PaulDate: 2003-06-26 21:24:36
Subject: Greater than a value
Previous:From: Nabil SayeghDate: 2003-06-26 21:17:11
Subject: Re: basic question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group