Re: how to show foreign keys of a table

From: "Dominic J(dot) Eidson" <sauron(at)the-infinite(dot)org>
To: pgsql-general(at)postgresql(dot)org
Cc: GH <grasshacker(at)over-yonder(dot)net>
Subject: Re: how to show foreign keys of a table
Date: 2000-12-31 05:35:00
Message-ID: Pine.LNX.4.21.0012302332030.15526-100000@morannon.the-infinite.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)toledolink(dot)com>
To: pgsql-hackers(at)postgresql(dot)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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eric Mueller 2000-12-31 06:46:51 detailed docs for functions
Previous Message GH 2000-12-31 05:26:04 Re: how to show foreign keys of a table