Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 42AF79FA4B2 for ; Wed, 27 Dec 2006 11:59:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 21349-07 for ; Wed, 27 Dec 2006 11:58:54 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from cicero0.cybercity.dk (cicero0.cybercity.dk [212.242.40.52]) by postgresql.org (Postfix) with ESMTP id BB9D79FA49E for ; Wed, 27 Dec 2006 11:58:54 -0400 (AST) Received: from agile.dk (0x3e42da3b.adsl.cybercity.dk [62.66.218.59]) by cicero0.cybercity.dk (Postfix) with ESMTP id EB99867A360; Wed, 27 Dec 2006 16:58:52 +0100 (CET) Received: from mail.agile.dk (localhost [127.0.0.1]) by agile.dk (Postfix) with ESMTP id 20E5EB0AB1; Wed, 27 Dec 2006 16:58:52 +0100 (CET) Received: from 62.66.218.59 (SquirrelMail authenticated user jma@agile.dk) by mail.agile.dk with HTTP; Wed, 27 Dec 2006 16:58:52 +0100 (CET) Message-ID: <1255.62.66.218.59.1167235132.squirrel@mail.agile.dk> In-Reply-To: <200612262027.kBQKR80j031116@amanda.contactbda.com> References: <1260.62.66.218.59.1167163837.squirrel@mail.agile.dk> <200612262027.kBQKR80j031116@amanda.contactbda.com> Date: Wed, 27 Dec 2006 16:58:52 +0100 (CET) Subject: Re: Related tables to a view From: "Jan Meyland Andersen" To: "Jim Buttafuoco" Cc: pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.217 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200612/174 X-Sequence-Number: 27130 > Try this query > > > select a.relname as base,a.relkind > from > pg_class a > join pg_depend d on (a.oid = d.refobjid) > join pg_class c on (d.classid = c.oid) > join pg_rewrite r on (objid = r.oid) > join pg_class v on (ev_class = v.oid) > where a.relkind in('r', 'v') > and a.relname <> v.relname > and v.relname='YOUR VIEW NAME HERE' > order by 1 > Thanks a lot. That is exactly what I need. Regards Jan