Re: Display View Columns and Their Source Tables and Columns

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: susan(dot)hurst(at)brookhurstdata(dot)com, Discuss List Postgres <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Display View Columns and Their Source Tables and Columns
Date: 2019-04-21 22:25:29
Message-ID: 640bb2c44746b8202429564ba2844c5d40d381c3.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Soni 2019-04-22 04:14:08 cache lookup failed for function 1 on fmgr_info_cxt_security, fmgr.c:184
Previous Message Adrian Klaver 2019-04-21 22:13:23 Re: Backup and Restore (pg_dump & pg_restore)