Re: Querying same lookup table with multiple columns based on another view - Mailing list pgsql-general

From Jim Nasby
Subject Re: Querying same lookup table with multiple columns based on another view
Date
Msg-id 564B51D3.4040804@BlueTreble.com
Whole thread Raw
In response to Re: Querying same lookup table with multiple columns based on another view  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general
On 11/17/15 9:21 AM, Melvin Davidson wrote:
> Your problem is the use of SELECT *

I've often wished for a way to do *, but make changes to the results
that a normal * would give you. The two operations I've wished for are
to either remove some fields from the list, or to rename some fields.

I suspect you could create a function that would do this. You wouldn't
want to just blindly operate on a CREATE VIEW command because of things like

SELECT a.*, b.blah FROM (SELECT 1,2,3) a, b

but I think it might be possible to get the raw data out of the parser
(the grammar certainly provides it). It would probably involve C code
though.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Querying same lookup table with multiple columns based on another view
Next
From: Jim Nasby
Date:
Subject: Re: referencing other INSERT VALUES columns inside the insert