Hey @l_avrot!
Question:
```
-- obviously null is null
$ SELECT NULL IS NULL;
-> t
-- row including only nulls is also null
$ SELECT ROW(NULL) IS NULL;
-> t
-- why row including a row including only nulls not null?
$ SELECT ROW(ROW(NULL)) IS NULL;
-> f
```
Should it be True?
-
Show this thread
-
Replying to @PavloGolub
Ok, so for what the SQL Standard calls "null predicate", we are clearly in the case where : > Let R be the <row value predicand> and let V be the value of R. > If the value of every field of V is the null value, then [the value of “R IS NULL” is] True. That explains the first 1.
1 reply 0 retweets 0 likes -
Replying to @l_avrot @PavloGolub
But it is not because `R is null` is true that the value of V is null.
1 reply 0 retweets 0 likes -
Replying to @l_avrot @PavloGolub
V still is a row with a field value that's null. So when you try `select row(row(null)) is null` It will evaluate if all the fields of row(row(null)) are equals to the null value, which means it will look at row(null) which is not equal to null. So the result is false.
1 reply 0 retweets 3 likes
This one's been a significant headache over the years, see e.g. bug #14235 https://postgr.es/m/20160708024746.1410.57282@wrigleys.postgresql.org … and associated commit https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4452000f310 …
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.