Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4E7569FA485 for ; Tue, 26 Dec 2006 16:10:47 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 19148-02 for ; Tue, 26 Dec 2006 16:10:39 -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 EDC729F9F46 for ; Tue, 26 Dec 2006 16:10:41 -0400 (AST) Received: from agile.dk (0x3e42da3b.adsl.cybercity.dk [62.66.218.59]) by cicero0.cybercity.dk (Postfix) with ESMTP id 5E460679938; Tue, 26 Dec 2006 21:10:37 +0100 (CET) Received: from mail.agile.dk (localhost [127.0.0.1]) by agile.dk (Postfix) with ESMTP id 01458B0AA3; Tue, 26 Dec 2006 21:10:36 +0100 (CET) Received: from 62.66.218.59 (SquirrelMail authenticated user jma@agile.dk) by mail.agile.dk with HTTP; Tue, 26 Dec 2006 21:10:37 +0100 (CET) Message-ID: <1260.62.66.218.59.1167163837.squirrel@mail.agile.dk> In-Reply-To: <20061226041029.GA61490@winnie.fuhr.org> References: <1404.62.66.218.59.1167083523.squirrel@mail.agile.dk> <20061226041029.GA61490@winnie.fuhr.org> Date: Tue, 26 Dec 2006 21:10:37 +0100 (CET) Subject: Re: Related tables to a view From: "Jan Meyland Andersen" To: "Michael Fuhr" Cc: "Jan Meyland Andersen" , 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.386 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200612/172 X-Sequence-Number: 27128 > You could query pg_depend to find out which tables and columns the > view's rewrite rule depends on but that's not as specific as what > you're requesting. I'm not aware of a way to associate a particular > table column with a particular view column short of parsing the view > definition or rule action; doing so would have to allow for the > possibility of a view column deriving its value from an arbitrarily > complex expression involving multiple tables, subqueries, etc. I have been thinking the problem through again, and I think I am able to solve the problem if I just know which tables the view is using. But how do I get this information from the pg_depend table? Regards Jan