From: | Susan Cassidy <scassidy(at)edgewave(dot)com> |
---|---|
To: | David Johnston <polobo(at)yahoo(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: { SELECT *->NOT(column1, column2) FROM table } syntax idea |
Date: | 2011-06-15 23:14:30 |
Message-ID: | 3A51F387FE0CC74D80FA60C146987F2501C3D2B033BA@oc-exchange1.stbernard.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Wouldn't it be easy enough to write a little program to suck in the column names from the information schema, and output the CREATE VIEW statement, excluding all the columns you want to exclude?
Then, if the tables have changed, just run the program, let it fetch the information from the information schema, do the DROP and CREATE, and you're done.
Susan C.
________________________________
From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of David Johnston
Sent: Wednesday, June 15, 2011 3:08 PM
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] { SELECT *->NOT(column1, column2) FROM table } syntax idea
Is there, or has there ever been, a discussion about introducing syntax to handle specifying which columns you do NOT want to output in the SELECT list?
The use case I am running into is mostly within VIEWS. I want to specify "SELECT * FROM table" but there are a couple of fields that I do NOT want to output (for instance a password hash field for a user table). I guess it would probably be better form to move those columns to a separate enhanced permissions table but since PostgreSQL allows for per-column permissions that is not strictly necessary. Listing all the wanted columns is not desirable though obviously possible. The main reason to avoid doing so is to allow for a view to output all the columns of the underlying tables. If I drop/create the view after altering the underlying tables the new view will have the additional columns without any direct change to the view being required.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | David Johnston | 2011-06-15 23:32:16 | Re: { SELECT *->NOT(column1, column2) FROM table } syntax idea |
Previous Message | David Johnston | 2011-06-15 23:09:07 | Re: { SELECT *->NOT(column1, column2) FROM table } syntax idea |