how do I do to get the foreign keys of a table? - Mailing list pgsql-general

From Roberto (SmartBit)
Subject how do I do to get the foreign keys of a table?
Date
Msg-id 013a01c27771$66255e50$1501a8c0@NoteBook
Whole thread Raw
Responses Re: how do I do to get the foreign keys of a table?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
This is my SQL to return the constraints...

select tgconstrname, tr.relname, fr.relname from pg_trigger, pg_class tr,
pg_class fr
where tr.oid = tgrelid and fr.oid = tgconstrrelid and
tr.relname='MyTableName'

 so, how do I do to get the  foreign keys of a table?

let me be more explicite, I want to get the name of fields from a table that
are related with other table! (foreign key)

NOTE: I want a SQL command to get it from any table of any PostgreSQL
database, so it can not be a function!

please help me

tia

Roberto de Amorim


pgsql-general by date:

Previous
From: "Williams, Travis L, NPONS"
Date:
Subject: Re: table overflow question
Next
From: "Williams, Travis L, NPONS"
Date:
Subject: Connection timeout..