Search Postgresql Archives

Re: Proper relational database?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 23, 2016 at 10:39 AM, Geoff Winkless <pgsqladmin@xxxxxxxx> 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.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux