Postgresql function check if variable is null.