get referential values

From: Esmin Gracic <esmin(dot)gracic(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: get referential values
Date: 2011-01-19 17:08:49
Message-ID: AANLkTi=3opLTPcHgGu9P6sM7ZiK2tXuam7v7egJHZvK=@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Knowing only tablename (schema_name.table_name) how to retrieve foreign keys
and related values. (using pg_catalog is preferred). I developing framework
for adobe flex (on php and postgresql).
Already figured out how to get primary key, not null columns and column
types, but kinda stuck here.
I can post these queries, if someone needs (it would be nice to have these
in wiki - where I've seen the query for primary key retrieval).

I need following format:

select .... 'schema_name.table_name'::regclass....

no | fk_name| table_column_name | foreign_table_name | foreign_column_name

no is used for composite foreign keys.

Thanks!

Esmin.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message tuanhoanganh 2011-01-19 17:23:13 Re: PostgreSQL 9.0.1 PITR can not copy WAL file
Previous Message Thomas Kellerer 2011-01-19 17:03:03 Re: How can I find a schema that a table belong to?