Fixed syntax error in postgres trigger function