Duplicated foreign key constraints

From: "Berend Tober" <btober(at)seaworthysys(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Duplicated foreign key constraints
Date: 2003-02-25 14:51:49
Message-ID: 64468.216.238.112.88.1046184709.squirrel@$HOSTNAME
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I don't really know how I did this, but I managed somehow to end up with
every foreign key constraint in my database duplicated. It probably
happened somehow in the process of pg_dump/restore when I made some kind
of mistake and accidentally imported part of the schema definition twice,
but how my database got this way is less important to me right now than
answering how can I clean-up the mess, i.e., how can I drop the second
copy of each foreign key constraint?

pgAdminII doesn't let me drop foreign key constraints. And looking the
system tables is complicated because what I define as a "constraint"
shows up as three rows in pg_catalog.pg_trigger (so I have six triggers
per table--two of each "on insert", "on delete", and "on update"), and it
is not obvious from looking at that table which row corresponds to which
trigger.

Got any suggestions?

~Berend Tober

Browse pgsql-general by date

  From Date Subject
Next Message Malghan, Ravi 2003-02-25 14:59:16 Re: Can postgresql be run in memory (like a memory resi
Previous Message Tom Lane 2003-02-25 14:43:10 Re: how do i avoid multiple sessions from inserting the