Update func_upsert_relation.sql