Re: Intersection or zero-column queries
Victor Yegorov <vyegorov@gmail.com>
From: Victor Yegorov <vyegorov@gmail.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Date: 2017-12-22T00:08:55Z
Lists: pgsql-general
2017-12-22 2:03 GMT+02:00 David G. Johnston <david.g.johnston@gmail.com>: > On Thu, Dec 21, 2017 at 4:53 PM, Victor Yegorov <vyegorov@gmail.com> > wrote: > >> postgres=# select except select; >> -- >> (2 rows) >> postgres=# select intersect all select; >> -- >> (2 rows) >> >> Why is it so? >> Should this be reported as a bug?.. ;) >> > > The intersection case seems correct - one row from each sub-relation is > returned since ALL is specified and both results as the same. > Actually, result will not change with or without `ALL` for both, EXCEPT and INTERSECT. Also, intersection should not return more rows, than there're in the sub-relations. -- Victor Yegorov
Commits
-
Disallow UNION/INTERSECT/EXCEPT over no columns.
- e1b8e0e4a61e 9.4.16 landed
- a84e90bb249d 9.5.11 landed
- bd29bc417e71 9.6.7 landed
-
Fix UNION/INTERSECT/EXCEPT over no columns.
- c252ccda7429 10.2 landed
- c4c2885cbb18 11.0 landed