Re: Intersection or zero-column queries

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ken Tanzer <ken.tanzer@gmail.com>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, Victor Yegorov <vyegorov@gmail.com>, "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Date: 2017-12-22T15:08:56Z
Lists: pgsql-general
Ken Tanzer <ken.tanzer@gmail.com> writes:
> I noticed I get this behavior in 9.6, but in 9.2 an empty select results in
> a syntax error.  Which just got me curious what caused the change, if it
> was deliberate, and if one or the other is more proper behavior.

Yes, it was an intentional change, see
https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=1b4f7f93b

There should be something about it in the 9.4 release notes.

			regards, tom lane


Commits

  1. Disallow UNION/INTERSECT/EXCEPT over no columns.

  2. Fix UNION/INTERSECT/EXCEPT over no columns.