Re: A modest proposal vis hierarchical queries: MINUS in the column list

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Mark Zellers <mark(dot)zellers(at)workday(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: A modest proposal vis hierarchical queries: MINUS in the column list
Date: 2021-06-08 15:00:56
Message-ID: 81b57a6b-9245-e603-6edf-56d52f3d2c38@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 6/7/21 6:10 PM, Tom Lane wrote:
> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
>> On Mon, Jun 7, 2021 at 1:54 PM Mark Zellers <mark(dot)zellers(at)workday(dot)com>
>> wrote:
>>> What if you could use the MINUS keyword in the column
>>> list of a select statement to remove a column from the result set returned
>>> to the client?
>> I asked this a decade ago and got no useful responses.
>> https://www.postgresql.org/message-id/flat/02e901cc2bb4%2476bc2090%24643461b0%24%40yahoo.com#3784fab26b0f946b3239266e3b70a6ce
> I can recall more-recent requests for that too, though I'm too lazy
> to go search the archives right now.
>
> I'm fairly disinclined to do anything about it though, because I'm
> afraid of the SQL committee standardizing some other syntax for the
> same idea in future (or maybe worse, commandeering the same keyword
> for some other feature). It doesn't seem quite valuable enough to
> take those risks for.
>
> Note that it's not like SQL hasn't heard of projections before.
> You can always do "SELECT a, b, d FROM subquery-yielding-a-b-c-d".
> So the proposed syntax would save a small amount of typing, but
> it's not adding any real new functionality.
>
>

True, but the problem happens when you have 250 fields and you want to
skip 4 of them. Getting that right can be a pain.

I agree that inventing syntax for this has the dangers you identify.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-06-08 15:21:34 Re: Multiple hosts in connection string failed to failover in non-hot standby mode
Previous Message Emre Hasegeli 2021-06-08 14:53:02 Re: GiST operator class for bool