Duplicated foreign key constraints - Mailing list pgsql-general

From Berend Tober
Subject Duplicated foreign key constraints
Date
Msg-id 64468.216.238.112.88.1046184709.squirrel@$HOSTNAME
Whole thread Raw
List 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




pgsql-general by date:

Previous
From: Ericson Smith
Date:
Subject: Re: 7.4?
Next
From: Andrew Sullivan
Date:
Subject: Re: 7.4?