SQL Query for Foreign constraint

From: Bhim Kumar <bhimkumar33(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: SQL Query for Foreign constraint
Date: 2014-03-20 08:01:02
Message-ID: CADzfoce9eW+rVirO58NFFzQ7LktHdcT57tA5cBZiuDk=cS5XDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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-sql by date

  From Date Subject
Next Message Igor Neyman 2014-03-20 13:48:15 Re: SQL Query for Foreign constraint
Previous Message Vik Fearing 2014-03-19 22:35:03 Re: Can I use a constraint to make sure all array elements are positive?