Postgres as a queue is one of the worst decisions I've seen made and I and others I've worked with have spent years of our lives unwinding the consequences.
Is your code handling different varieties of event states stored in your database?
Why implement this as a monolithic data source? Was it not possible to separate different states by additional queues?
Curious to hear the decision making process here. Maybe I can see it for low volume?
If there is a two phase process then you just need idempotence and can safely transact with the db.