Re: Proper relational database?

From: Manuel Gómez <targen(at)gmail(dot)com>
To: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, david(at)andl(dot)org, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Proper relational database?
Date: 2016-04-23 16:19:35
Message-ID: CAJWnFaMkDskHNfHtXn=LOa5OBrQ983ZwmQQGOHMWQnMNfiUCDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Apr 23, 2016 at 10:39 AM, Geoff Winkless <pgsqladmin(at)geoff(dot)dj> wrote:
> SELECT with no values is selecting a NULL, and two NULLs do not
> equate, so you would expect two rows.

This is precisely what I mean by wonky semantics: it makes no sense
for a nullary relation to be interpreted as selecting a NULL. A row
with no columns should have different semantics from a row with one
NULL column. Indeed it does in other contexts; note its correct
behavior as the neutral for the cross join operator:

postgres=# select * from (values (42)) as t(n) cross join (select) as dee;
n
----
42
(1 row)

postgres=# select * from (values (42)) as t(n) cross join (select
NULL) as not_dee;
n | ?column?
----+----------
42 |
(1 row)

The empty tuple should equal itself and its semantics should have
nothing at all to do with NULL, and thence I expect one row. I've
even been tempted to file a bug report, but I fear it may be brushed
off as pedantry.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tomas J Stehlik 2016-04-23 16:30:44 Is it possible to recover the schema from the raw files?
Previous Message Joshua D. Drake 2016-04-23 15:26:00 Re: Proper relational database?