Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

From: Gilles Darold <gillesdarold(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Proposal for HIDDEN/INVISIBLE column
Date: 2021-10-14 21:03:23
Message-ID: 91a577fd-f259-4526-5767-33a69a6c01bf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le 14/10/2021 à 22:01, Gavin Flower a écrit :
> On 15/10/21 07:01, Josef Šimánek wrote:
>> čt 14. 10. 2021 v 13:17 odesílatel Gilles Darold <gilles(at)migops(dot)com>
>> napsal:
>>> Hi,
>>>
>>>
>>> Here is a proposal to implement HIDDEN columns feature in PostgreSQL.
>>>
>>> The user defined columns are always visible in the PostgreSQL. If user
>>> wants to hide some column(s) from a SELECT * returned values then the
>>> hidden columns feature is useful. Hidden column can always be used and
>>> returned by explicitly referring it in the query.
>>>
>>> I agree that views are done for that or that using a SELECT * is a bad
>>> practice
>>> but sometime we could need to "technically" prevent some columns to
>>> be part
>>> of a star expansion and nbot be forced to use view+rules.
>> Just to remind here, there was recently a proposal to handle this
>> problem another way - provide a list of columns to skip for "star
>> selection" aka "SELECT * EXCEPT col1...".
>>
>> https://postgrespro.com/list/id/d51371a2-f221-1cf3-4a7d-b2242d4dafdb(at)gmail(dot)com
>>
>
> [...]
>
> I feel using EXCEPT would be a lot clearer, no one is likely to be
> mislead into thinking that its is a security feature unlike 'HIDDEN'. 
> Also you know that SELECT * will select all columns.
>
> If this kind of feature were to be added, then I'd give a +1 to use
> the EXCEPT syntax.

I don't think that the EXCEPT syntax will be adopted as it change the
SQL syntax for SELECT in a non standard way. This is not the case of the
hidden column feature which doesn't touch of the SELECT or INSERT syntax.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2021-10-14 21:06:00 Re: BUG #17212: pg_amcheck fails on checking temporary relations
Previous Message John Naylor 2021-10-14 20:54:34 Re: [RFC] building postgres with meson