4 ms·
I quite like how PG treats Null values in it's SQL, as described in the blog post; undecided. It allows me to express some very interesting properties in system
by zaarn 9y ago
I quite like how PG treats Null values in it's SQL, as described in the blog post; undecided. It allows me to express some very interesting properties in systems.
Suppose we have a permission system for some webapp. With using Null as permission to access a user profile we can express three end states; Return 403 Unauthoried (FALSE), Return 404 Not Found (NULL) and Return 200 OK (TRUE).
That way a user not logged in or with no specific permissions will not know a profile exists. However if they have been added to the deny list they get a deny error. Otherwise they see the profile.
It's quite neat in that way.