´You do not need to delete xotcl, applying the changes of [1] to xotcl-core/tcl/05-db-procs.tcl is sufficient (when you have a recent version of xotcl-core).
With the new code, the somewhat simplified version of your function
CREATE OR REPLACE FUNCTION mandat__new(
integer,
varchar,
varchar
)
RETURNS integer AS $$
DECLARE
p_mandat_id ALIAS FOR $1;
p_code ALIAS FOR $2;
p_type_of_transaction ALIAS FOR $3;
BEGIN
return 1;
END;
$$ LANGUAGE plpgsql;
is loaded as expected, and no error is triggered (but a few warnings about missing argument names). Btw, you should define the function with named parameters as used all over in newer OpenACS versions in the style of
CREATE OR REPLACE FUNCTION mandat__new(
p_mandat_id integer,
p_type_of_transaction varchar,
p_type_of_property varchar
)
RETURNS integer AS $$
DECLARE
BEGIN
return 1;
END;
$$ LANGUAGE plpgsql;
Be aware, that if you are trying multiple variants of a SQL function (like mandat__new), you might have multiple versions of this function defined in you DB, and the the loading process checks, what's in the DB. So, clean up first to avoid confusions.
[1] http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl?r1=1.103.2.36&r2=1.103.2.37