I've noticed that select NULL=NULL; yields TRUE. It is also possible to select rows in this manner.
At the same time in PL/pgSQL:
> drop function demo1(); create function demo1() returns boolean as ' declare a boolean:=NULL; b boolean:=NULL; begin return a=b; end; ' language 'plpgsql';
> select demo1(); yields NULL. Yet if I'd written "return NULL=NULL" I would have gotten the same result as in the simple query;
Is there any logical explanation for this inconsistency? ... or should I have been posting a bug? :-)