Just no, your tasks should be idempotent. Distributed transactions are stupid.

They’re not talking about distributed transactions: it’s not about a task being published and consumed atomically, it’s about it being consumed and executed atomically.

the workers aren't talking to postgres directly, thats why you would need distributed transactions.