pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: susan.hurst@brookhurstdata.com
To: Discuss List Postgres <pgsql-general@lists.postgresql.org>
Subject: Re: Display View Columns and Their Source Tables and Columns
Date: Mon, 22 Apr 2019 00:25:29 +0200
Message-ID: <640bb2c44746b8202429564ba2844c5d40d381c3.camel@cybertec.at> (raw)
In-Reply-To: <ca71fbd91c756d4b00de31f02b8f72d3@mail.brookhurstdata.net>
References: <ca71fbd91c756d4b00de31f02b8f72d3@mail.brookhurstdata.net>

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






view thread (3+ messages)

Message-ID: <640bb2c44746b8202429564ba2844c5d40d381c3.camel@cybertec.at>
Permalink:  ../640bb2c44746b8202429564ba2844c5d40d381c3.camel@cybertec.at/
Also on:    postgresql.org/message-id/640bb2c44746b8202429564ba2844c5d40d381c3.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, susan.hurst@brookhurstdata.com
  Subject: Re: Display View Columns and Their Source Tables and Columns
  In-Reply-To: <640bb2c44746b8202429564ba2844c5d40d381c3.camel@cybertec.at>
  References: <ca71fbd91c756d4b00de31f02b8f72d3@mail.brookhurstdata.net> <640bb2c44746b8202429564ba2844c5d40d381c3.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox