Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql,v
diff -u -N -r1.39.2.3 -r1.39.2.4
--- openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql	5 Jul 2016 16:35:23 -0000	1.39.2.3
+++ openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql	6 Jul 2016 07:40:56 -0000	1.39.2.4
@@ -724,10 +724,8 @@
        p_party_id  integer, 
        p_privilege varchar
 ) RETURNS table (object_id integer, orig_object_id integer) AS $$
-BEGIN
-  RETURN QUERY SELECT acs_permission.permission_p_recursive_array(p_objects, p_party_id, p_privilege);
-END; 
-$$ LANGUAGE plpgsql stable;
+  SELECT acs_permission.permission_p_recursive_array(p_objects, p_party_id, p_privilege);
+$$ LANGUAGE sql stable;
 
 
 select define_function_args('acs_permission__grant_permission','object_id,grantee_id,privilege');
