NO,Functions and triggers doesn't start any transaction, it must be in a upper-level transaction, this since Postgresqldoesn'n support nested transactions.
therefore it is unsafe in multi-user enviroments :(