On Tue, Feb 25, 2020 at 2:18 AM Stanislav Motyčka
<stanislav.motycka@gmail.com> wrote:
> Sometimes (for tables with many columns) it would be better and easier to write "SELECT" statement with clause
"EXCEPT":
> "SELECT * [EXCEPT col1 [,col2]] FROM ..."
I've wanted this feature lots of times and would be delighted to see
it in Postgres.
On Tue, Feb 25, 2020 at 6:51 AM Miles Elam <miles.elam@productops.com> wrote:
> Do you mean
> "select everything from tablex except for tablex.col1, and also select tablex.col2 and tabley.col1"
> or
> "select everything from tablex except for tablex.col1 AND tablex.col2, and also select tabley.col1"
> ?
I take the proposal to mean this:
SELECT listOfColumns [EXCEPT listOfColumns] FROM ...
not this:
SELECT listOfColumns [EXCEPT (listOfColumns) [listOfColumns [EXCEPT
(listOfColumns)]]]... FROM ...
So there is always a single EXCEPT clause (if any) and it comes after
the entire SELECT clause. Then there is no ambiguity. Also this
approach makes the feature easy to understand and use. I don't see any
benefit to letting people interleave selected & excepted columns.
Regards,
Paul