Postgres Nulls Not Distinct Sql Function