Intersection or zero-column queries

From: Victor Yegorov <vyegorov(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Intersection or zero-column queries
Date: 2017-12-21 23:53:35
Message-ID: CAGnEbojGJrRSOgJwNGM7JSJZpVAf8xXcVPbVrGdhbVEHZ-BUMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings.

One can issue an empty `SELECT` statement and 1 row without columns will be
returned:

postgres=# select;
--
(1 row)

However, if I'll do `EXCPET` or `INTERSECT` of such queries, I'll get 2
rows:

postgres=# select except select;
--
(2 rows)
postgres=# select intersect all select;
--
(2 rows)

Why is it so?
Should this be reported as a bug?.. ;)

--
Victor Yegorov

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-12-22 00:03:35 Re: Intersection or zero-column queries
Previous Message Melvin Davidson 2017-12-21 23:50:13 Re: [v10] CREATE TEMP FUNCTION/CREATE FUNCTION PG_TEMP.X