Postgresql Check For Empty Object