Re: Proper relational database? - Mailing list pgsql-general

From Manuel Gómez
Subject Re: Proper relational database?
Date
Msg-id CAJWnFaMkDskHNfHtXn=LOa5OBrQ983ZwmQQGOHMWQnMNfiUCDA@mail.gmail.com
Whole thread Raw
In response to Re: Proper relational database?  (Geoff Winkless <pgsqladmin@geoff.dj>)
List pgsql-general
On Sat, Apr 23, 2016 at 10:39 AM, Geoff Winkless <pgsqladmin@geoff.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.


pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Proper relational database?
Next
From: "Tomas J Stehlik"
Date:
Subject: Is it possible to recover the schema from the raw files?