Do not insert userlogs within local transactions enabled by XA. Inserts do not return an error, but do not extract userlogs for such transactions.
Do not insert a userlog in a subtransaction that begins with a SAVEPOINT statement and ends with a RELEASE SAVEPOINT or ROLLBACK TO statement. If so, the insertion function returns SQLSTATE: 0A000 and the subtransaction is ABORT internally. Use the RELEASE SAVEPOINT or ROLLBACK TO statement to terminate the subtransaction.
Do not insert a userlog inside a PL/pgSQL block using an EXCEPTION clause. This is because the start of such a block implicitly starts a subtransaction. If the userlog is inserted in a stored procedure that includes an EXCEPTION clause, SQLSTATE: 0A000 is returned.
Do not insert userlogs in any PL other than PL/pgSQL. This is because such PLs invariably use subtransactions. If a userlog was inserted in a PL other than PL/pgSQL, SQLSTATE: 0A000 is returned.