finding foreign keys - Mailing list pgsql-sql

From Ron Peterson
Subject finding foreign keys
Date
Msg-id 3A6DFCA1.248D0979@yellowbank.com
Whole thread Raw
List pgsql-sql
Can anyone suggest a more elegant way of finding foreign keys than
parsing the tgargs value returned by this query?  I'd really rather do
pure SQL, sans string parsing, if possible.

------------------------------------------------------------------------
-- Find tables and foreign keys

CREATE VIEW foreignkeysa ASSELECT    t.oid as toid,    c1.relname AS relid,    c2.relname AS constrrelid,    t.tgargs
AStgargs
 
FROM    pg_trigger AS t,    pg_class AS c1,    pg_class AS c2
WHERE    t.tgrelid=c1.oid AND    t.tgconstrrelid=c2.oid AND    t.tgfoid=1644;
------------------------------------------------------------------------

-Ron-


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: select returns no line
Next
From: Brett Schwarz
Date:
Subject: Rules and transactions