Re:Three-Valued Logic
by lmm on Friday December 15, 2017 @06:44AM
(#15931146)
Which is worse. Null references are at least relatively fail-fast. SQL null propagates and so you get the error a long way away from the original source, like with Javascript's "foo is not a property of undefined".
[ Parent
| on HN ]
Re:Three-Valued Logic
by default-kramer on Friday December 15, 2017 @12:48PM
(#15933562)
Exactly. I've wondered why no SQL implementation (that I know of) has optional assertions like "join exactly 1 some_table" or "select assert-not-null(some_column)". I don't see any reason why this would be a performance killer; in fact, it might even be possible to prove and then cache with the query plan.