]> granicus.if.org Git - postgresql/commit
Disallow UNION/INTERSECT/EXCEPT over no columns.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 22 Dec 2017 17:08:28 +0000 (12:08 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 22 Dec 2017 17:08:28 +0000 (12:08 -0500)
commitbd29bc417e7130312b47ba0da244c020a0193694
treeb83e296722def591e9a1b7e35f98cc881da680f7
parent23b63417e20d548d281cd8f904f6f2ffcebddc8c
Disallow UNION/INTERSECT/EXCEPT over no columns.

Since 9.4, we've allowed the syntax "select union select" and variants
of that.  However, the planner wasn't expecting a no-column set operation
and ended up treating the set operation as if it were UNION ALL.

Pre-v10, there seem to be some executor issues that would need to be
fixed to support such cases, and it doesn't really seem worth expending
much effort on.  Just disallow it, instead.

Per report from Victor Yegorov.

Discussion: https://postgr.es/m/CAGnEbojGJrRSOgJwNGM7JSJZpVAf8xXcVPbVrGdhbVEHZ-BUMw@mail.gmail.com
src/backend/optimizer/prep/prepunion.c