There is a typo in the function that prevent to run it twice
ERROR: trigger "nx_trig_ancestos_update" for relation "hierarchy" already exists État SQL :42710 Contexte : SQL function "nx_ancestors_create_triggers" statement 6 SQL statement "SELECT nx_ancestors_create_triggers()" PL/pgSQL function "nx_init_ancestors" line 6 at PERFORM