Search Postgresql Archives

Re: a proposal for a new functionality: "SELECT * [EXCEPT col1 [,col2]]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx <mailto:stanislav.motycka@xxxxxxxxx>> 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.






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux