How To Use If Condition In Postgresql