pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>
To: Josef Šimánek <josef.simanek@gmail.com>
To: Stanislav Motyčka <stanislav.motycka@gmail.com>
Cc: pgsql-general@postgresql.org >> PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: a proposal for a new functionality: "SELECT * [EXCEPT col1 [,col2]]
Date: Tue, 25 Feb 2020 10:52:37 +0000
Message-ID: <1d18c9e2-ce3f-05b8-5b6e-3b959c527dac@ocado.com> (raw)
In-Reply-To: <CAFp7Qwr9j_JFH2MMgmV2YbBqBn9Vu3xPKSLxvghMf5WnsL4Ljg@mail.gmail.com>
References: <d51371a2-f221-1cf3-4a7d-b2242d4dafdb@gmail.com>
	<CAFp7Qwr9j_JFH2MMgmV2YbBqBn9Vu3xPKSLxvghMf5WnsL4Ljg@mail.gmail.com>

That makes sense, however for my general use case I'd also like the 
ability to mark some columns as not match-able by `SELECT * FROM 
<table>` and `TABLE <table>`  at table definition without having to 
create dedicated views (think of the way system attributes such as 
tableoid, cmax, cmin ... are handled) .



Typical use case: manual inspection of rows containing an hefty payload 
field and some metadata ones; the payload more often than not isn't the 
bit I'm interested in, but the size of it dominates the output making it 
hard to read (granted - psql has formatting options to handle that, but 
having a sane default at the table level would help a lot).



One may argue that such behaviour breaks the principle of least 
surprise, so all of this should probably be strictly opt-in (and perhaps 
queries could output some hints that such hidden columns exists).



Regards


F



On 25/02/2020 10:30, Josef Šimánek wrote:
> Just to mention, similar concept can be found in Google BigQuery.
> 
> https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#select-except
> https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#select-replace
> 
> út 25. 2. 2020 v 11:18 odesílatel Stanislav Motyčka 
> <stanislav.motycka@gmail.com <mailto:stanislav.motycka@gmail.com>> napsal:
> 
>     Hello,
> 
>     Sometimes (for tables with many columns) it would be better and
>     easier to write "SELECT" statement with clause "EXCEPT":
>     "SELECT * [EXCEPT col1 [,col2]] FROM ..."
> 
>     It's easier to write "except" one or two columns from all (*) as to
>     write names of all columns besides one or two.
>     What do you thin about it?
> 
>     Best regards
>     Stano Motycka
> 

-- 
Regards

Fabio Ugo Venchiarutti
OSPCFC Network Engineering Dpt.
Ocado Technology

-- 


Notice: 
This email is confidential and may contain copyright material of 
members of the Ocado Group. Opinions and views expressed in this message 
may not necessarily reflect the opinions and views of the members of the 
Ocado Group.

If you are not the intended recipient, please notify us 
immediately and delete all copies of this message. Please note that it is 
your responsibility to scan this message for viruses.

References to the 
"Ocado Group" are to Ocado Group plc (registered in England and Wales with 
number 7098618) and its subsidiary undertakings (as that expression is 
defined in the Companies Act 2006) from time to time. The registered office 
of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way, 
Hatfield, Hertfordshire, AL10 9UL.





view thread (14+ messages)  latest in thread

Message-ID: <1d18c9e2-ce3f-05b8-5b6e-3b959c527dac@ocado.com>
Permalink:  ../1d18c9e2-ce3f-05b8-5b6e-3b959c527dac@ocado.com/
Also on:    postgresql.org/message-id/1d18c9e2-ce3f-05b8-5b6e-3b959c527dac@ocado.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: f.venchiarutti@ocado.com, josef.simanek@gmail.com, stanislav.motycka@gmail.com
  Subject: Re: a proposal for a new functionality: "SELECT * [EXCEPT col1 [,col2]]
  In-Reply-To: <1d18c9e2-ce3f-05b8-5b6e-3b959c527dac@ocado.com>
  References: <d51371a2-f221-1cf3-4a7d-b2242d4dafdb@gmail.com> <CAFp7Qwr9j_JFH2MMgmV2YbBqBn9Vu3xPKSLxvghMf5WnsL4Ljg@mail.gmail.com> <1d18c9e2-ce3f-05b8-5b6e-3b959c527dac@ocado.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox