Re: [PATCH] Proposal for HIDDEN/INVISIBLE column - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: [PATCH] Proposal for HIDDEN/INVISIBLE column
Date
Msg-id CAJ7c6TMF8f0+jchGt2wiiopapuzik6uqFAVE+epTS=k=j46VxQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Proposal for HIDDEN/INVISIBLE column  (Gilles Darold <gillesdarold@gmail.com>)
Responses Re: [PATCH] Proposal for HIDDEN/INVISIBLE column
List pgsql-hackers
Hi hackers,

> > 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@gmail.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.

+1 to that, personally I would love to have SELECT * EXCEPT ... syntax
in PostgreSQL. Also, I discovered this feature was requested even
earlier, in 2007 [1]

> 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.

HIDDEN columns affect SELECT and INSERT behaviour in the same
non-standard way, although maybe without changing the syntax.
Personally, I believe this is even worse. The difference is that with
`SELECT * EXCEPT` you explicitly state what you want, while HIDDEN
columns do this implicitly. Extending the syntax beyond standards in a
reasonable way doesn't seem to be a problem. As a recent example in
this thread [2] the community proposed to change the syntax in
multiple places at the same time.

`SELECT * EXCEPT` solves the same problem as HIDDEN columns, but is
much easier to implement and maintain. Since it's a simple syntax
sugar it doesn't affect the rest of the system.

[1]: https://www.postgresql.org/message-id/flat/8A38B86D9187B34FA18766E261AB3AEA0D2072%40sageograma.GEO-I.local
[2]: https://www.postgresql.org/message-id/flat/CAJ7c6TPx7N-bVw0dZ1ASCDQKZJHhBYkT6w4HV1LzfS%2BUUTUfmA%40mail.gmail.com

-- 
Best regards,
Aleksander Alekseev



pgsql-hackers by date:

Previous
From: Andrew Bille
Date:
Subject: Re: [Proposal] Global temporary tables
Next
From: Pavel Borisov
Date:
Subject: Re: Partition Check not updated when insert into a partition