Postgresql Create View With If Statement