Even more difficult in PG functions as they have no commit / rollback capability. I haven't played with stored procedures in in PG11 yet.
You can simulate oracle autonomous transaction feature in postgres by connecting to the same db using dblink.
As for implicit passing of error parameters, I don't think it's possible. Best, Alex