Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Gilles Darold <gilles(at)migops(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Proposal for HIDDEN/INVISIBLE column
Date: 2021-10-15 09:32:53
Message-ID: c0ddb9930ee2061d8b54d32447df8d15e23c6ac7.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2021-10-14 at 13:16 +0200, Gilles Darold wrote:
> 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.

When I read your proposal, I had strangely mixed feelings:
"This is cute!" versus "Do we need that?". After some thinking, I think
that it boils down to the following:

That feature is appealing to people who type SQL statements into psql,
which is probably the majority of the readers on this list. It is
immediately clear that this can be used for all kinds of nice things.

On the other hand: a relational database is not a spreadsheet, where
I want to hide or highlight columns. Sure, the interactive user may
use it in that way, but that is not the target of a relational database.
Databases usually are not user visible, but used by an application.
So the appeal for the interactive user is really pretty irrelevant.

Now this patch makes certain things easier, but it adds no substantially
new functionality: I can exclude a column from display as it is, simply
by listing all the other columns. Sure, that's a pain for the interactive
user, but it is irrelevant for a query in an application.

This together with the fact that it poses complicated questions when
we dig deeper, such as "what about whole-row references?", tilts my vote.
If it were for free, I would say +1. But given the ratio of potential
headache versus added real-life benefit, I find myself voting -1.

Still, it is cute!

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message torikoshia 2021-10-15 10:12:26 Re: RFC: Logging plan of the running query
Previous Message Gilles Darold 2021-10-15 09:16:04 Re: [PATCH] Proposal for HIDDEN/INVISIBLE column