Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIKuB-0007l3-R1 for pgsql-general@arkaria.postgresql.org; Sun, 21 Apr 2019 22:25:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIKuA-0001Pb-Hp for pgsql-general@arkaria.postgresql.org; Sun, 21 Apr 2019 22:25:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIKuA-0001PL-54 for pgsql-general@lists.postgresql.org; Sun, 21 Apr 2019 22:25:46 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIKu7-00047r-5W for pgsql-general@lists.postgresql.org; Sun, 21 Apr 2019 22:25:44 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id B4B6E4BFC3; Mon, 22 Apr 2019 00:25:39 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id uae8pc5jK3lG; Mon, 22 Apr 2019 00:25:31 +0200 (CEST) Message-ID: <640bb2c44746b8202429564ba2844c5d40d381c3.camel@cybertec.at> Subject: Re: Display View Columns and Their Source Tables and Columns From: Laurenz Albe To: susan.hurst@brookhurstdata.com, Discuss List Postgres Date: Mon, 22 Apr 2019 00:25:29 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Susan Hurst wrote: > I'm so close but I can't quite figure out how to match view columns to > their source columns in a query. There is no simple way to find which view column matches which column in the original table. Don't forget that the column could be defined as an expression that involves several columns of the base table. You'd have to parse pg_rewrite.ev_action. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com