Postgresql short-circuit evaluation

The purpose of this post is to demonstrate that Postgres follows short-circuit evaluation. That means, if you are checking two boolean values, if you are seeing if one or the other is true, and the first one is true, then you don’t need to check the second one, because you know the whole statement is true. For example:

true or true: true; when we see “or”, we know that because the first statement was “true”, we don’t need to check the second statement.
true or false: true; same answer as above, for the same reason. this statement is still true even though the second part of the statement is “false”, because the first part is true and it’s joined using “or”.
Read more Postgresql short-circuit evaluation