Re: Foreign keys - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Foreign keys
Date
Msg-id Pine.BSF.4.21.0102191302560.84309-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Foreign keys  (MMM <mamuma@eresmas.com>)
List pgsql-general
You can reconstruct the information out of the triggers
that are created in pg_trigger.  It's not easy to
parse however.

There are three triggers created for each fk constraint,
one on the fk table, two on the pk table.  You can
get the tables, columns constrained and match type from
the tgargs.  The referential actions are determined
by the function oids of the pk table triggers (do something
like:
 select pg_proc.proname from pg_trigger,pg_proc where
  pg_trigger.tgfoid=pg_proc.oid;
to get the function names which will look like:
RI_FKey_<action>_(upd|del)
for update or delete, <action> is the action defined.

On Sat, 17 Feb 2001, MMM wrote:

> Sorry for my bad English
>
> I'd like to know how I can see the foreign keys for a table.
>
> Is there a system table where I can do a Select?;
>
> Thank you.
>


pgsql-general by date:

Previous
From: Dave Edmondson
Date:
Subject: Re: Re: Postgres slowdown on large table joins
Next
From: Stephan Szabo
Date:
Subject: Re: not using table aliases in where clause slow-down?