Re: how to show foreign keys of a table - Mailing list pgsql-general

From Dominic J. Eidson
Subject Re: how to show foreign keys of a table
Date
Msg-id Pine.LNX.4.21.0012302332030.15526-100000@morannon.the-infinite.org
Whole thread Raw
In response to Re: how to show foreign keys of a table  (GH <grasshacker@over-yonder.net>)
List pgsql-general
On Sat, 30 Dec 2000, GH wrote:

> > Er, it smells like that only shows triggers, rather than foreign key
> > constraints. Correct?
>
> Ah hell, foreign keys constraints are triggers, right?

To quote Mike's email:

Date: Mon, 4 Dec 2000 23:28:32 -0500 (EST)
From: Michael Fork <mfork@toledolink.com>
To: pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] SQL to retrieve FK's, Update/Delete action,
etc. (fwd)

There ya go, I figured it out :)  Given the name a table, this query will
return all foreign keys in that table, the table the primary key is in,
the name of the primary key, if the are deferrable, if the are initially
deffered, and the action to be performed (RESTRICT, SET NULL, etc.).  To
get the foreign keys and primary keys and tables, you must parse the
null-terminated pg.tgargs.


Good night :)

--
Dominic J. Eidson
                                        "Baruk Khazad! Khazad ai-menu!" - Gimli
-------------------------------------------------------------------------------
http://www.the-infinite.org/              http://www.the-infinite.org/~dominic/


pgsql-general by date:

Previous
From: GH
Date:
Subject: Re: how to show foreign keys of a table
Next
From: "Eric Mueller"
Date:
Subject: detailed docs for functions