NULL behavior as part of an array or row expression has some unusual behaviors that it is best just to memorize:

SELECT NULL::INTEGER[] IS NULL;
 ?column?
----------
 t
 
SELECT '{}'::INTEGER[] IS NULL;
 ?column?
----------
 f
 
SELECT '{NULL}'::INTEGER[] IS NULL;
 ?column?
----------
 f

Continue Reading »