SQL Query for Foreign constraint

From: Bhim Kumar <bhimkumar33(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: SQL Query for Foreign constraint
Date: 2014-03-20 07:48:57
Message-ID: CADzfocdYDwD5Cdir8RvAAx68wFZyQfmEMUOqdDpszCTm0S-RGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi sir

Currently I am using following query on mysql :

* SHOW TABLES; ---> To get list of table in a particular db.
*
SELECT TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME,
REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME from
information_schema.key_column_usage WHERE constraint_schema
='myDBName';
---> to get foreign constraint information.
* SHOW INDEX FROM myTableName FROM myDBName;

I am required to get above information from postgres.

I didn't find postgres query corresponding to above mysql query to fetch
corresponding information.

PS : help me for above query in postgres.

Best Regards.
Bhim

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eduardo Morras 2014-03-20 08:56:14 Re: High Level Committers Wanted
Previous Message Venkata Balaji Nagothi 2014-03-20 03:31:05 Re: Hot standby read slaves exceed max delay on WAL segment. Replication lag.