{} appears to be an empty array, which explains that the value NOT NULL and ARRAY_LENGTH({}) does not return anything, although I expect it to return 0 on {} , it is possible that a PostgreSQL feature that I am unfamiliar with.
Is there a reason why you cannot just check the return value of ARRAY_LENGTH , for example.
SELECT id FROM table WHERE ARRAY_LENGTH(black_list, 1) IS NULL OR ARRAY_LENGTH(black_list, 1) < 1
Assuming ARRAY_LENGTH() does not lose the mind about empty values, for example, for id=12 in the above example, it looks like this would do the trick.
source share