Postgresql Check For Empty Dataframe R