It was because of a missing line in the acs-kernel/sql/postgresql/acs-relationships-create.sql file, this is the missing line:
select define_function_args('acs_rel__new','rel_id,rel_type,object_id_one,object_id_two,context_id,creation_user,creation_ip');
That's why the call to acs_rel_new in the "auto-generated" function was wrong. I tried this and it is working fine now. This was fixed in HEAD.
jopez