Postgresql Trigger Function If Condition In Excel