Get all of the tables linked by a Foreign Key
Here is a handy little PostgreSQL query that will list all of the tables linked by a foreign key to the table YOUR_TABLE. The output will include the keys on each side. This can be very useful if you want to build up a map of your database through the relationships between the tables. select …