Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6A3252E0161 for ; Wed, 26 Mar 2008 15:19:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 33930-01-8 for ; Wed, 26 Mar 2008 15:19:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtp156.sat.emailsrvr.com (smtp156.sat.emailsrvr.com [66.216.121.156]) by postgresql.org (Postfix) with ESMTP id 10AFE2E00D5 for ; Wed, 26 Mar 2008 15:19:23 -0300 (ADT) Received: from relay5.relay.sat.mlsrvr.com (localhost [127.0.0.1]) by relay5.relay.sat.mlsrvr.com (SMTP Server) with ESMTP id 6B1E01E46A1 for ; Wed, 26 Mar 2008 14:19:21 -0400 (EDT) Received: by relay5.relay.sat.mlsrvr.com (Authenticated sender: matthew-AT-zeut.net) with ESMTP id 2472D1E474D for ; Wed, 26 Mar 2008 14:19:21 -0400 (EDT) Message-ID: <47EA93B2.8000206@zeut.net> Date: Wed, 26 Mar 2008 14:19:30 -0400 From: "Matthew T. O'Connor" User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Finding all References to a Primary Key Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/183 X-Sequence-Number: 30511 I'm sorry if this is has been discussed, but I tried to find the answer in the archives and failed, so... How do I find all the rows in other tables that reference a specific row in another table? I'm only trying to find rows that are in tables where there is a Foreign Key referencing the primary key of the table in question. Example: Table People has a primary key of people_id There are say 20 tables that have foreign keys referencing people.people_id How do I find all the rows in all of those 20 tables that reference a particular person in the people table? Thank you in advance, Matthew O'Connor