On Sat, Apr 23, 2016 at 12:05 AM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> FWIW standard SQL may not allow it but Postgres does, and it's even
> possible to exclude duplicates by using an expression that references
> the whole row.
Indeed, but its semantics can be rather wonky. Witness:
postgres=# select 1;
?column?
----------
1
(1 row)
postgres=# select 1 union select 1;
?column?
----------
1
(1 row)
postgres=# select;
--
(1 row)
postgres=# select union select;
--
(2 rows)
postgres=# select 1 intersect select 1;
?column?
----------
1
(1 row)
postgres=# select intersect select;
--
(2 rows)