postgresql select count distinct multiple columns