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).