If I actively BEGIN a transaction, but fail to ROLLBACK at error, will PG become confused?
The transaction won't be &quot;auto rolled back&quot;, it will be marked as failed, and the only option you have, is to do a rollback.
If you did not run rollback in the function but simply return from it in case of an error, then the UPDATE following the function call would result in &quot;current transaction is aborted, commands ignored until end of transaction block&quot; - so the UPDATE can't be run either (again: only if you omit the rollback in the function in case of an error).

Unrelated to your question, but: your UPDATE will (implicitly) run in a second (different) transaction if your insert succeeds because your function cleanly ends the transaction that was started in there. If you did mean to run insert and update in the same transaction, your code is not going to do that.