Re: Working with foreign key constraints

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Steve Lane <slane(at)moyergroup(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Working with foreign key constraints
Date: 2002-10-21 15:25:22
Message-ID: 20021021082349.G71250-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 19 Oct 2002, Steve Lane wrote:

> All:
>
> A couple of quick questions about foreign key constraints.
>
> Any good way to view them in pgsql? A simple \dt will show me indexes, but
> no constraints.
>
> I understand that they're implemented with triggers. I've seen varying
> accounts of how many. Two? Or three? I'm trying to drop some FK constraints,
> with no luck. Dropping the two likely-looking triggers didn't do it -- still
> got integrity violations on certain operations.
>
> Any good source of data for this online? Did not find much at
> techdocs.postgresql.org, or at least I looked in the wrong place.

The foreign key tutorials at techdocs should go into details, but there
are currently three triggers created per constraint, two on the referenced
table and one on the referencing table. You'll need to drop all three
before the constraint is really gone.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Wood 2002-10-21 15:41:44 Re: transactions
Previous Message Patrick Fiche 2002-10-21 15:23:54 Re: pg_attribute always grow...