News for hackers. Stuff that matters.
Re:The pitfall of using PostgreSQL advisory locks with Go's ... by zeroimpl on Saturday August 31, 2019 @09:19PM (#20849923)
Seems like if you tried to use transactions, you'd have the same problem?
Re:The pitfall of using PostgreSQL advisory locks with Go's ... by karmakaze on Saturday August 31, 2019 @10:42PM (#20850216)
A transaction executes all commands using the same connection so it would have worked. The semantics are different though where the commands issued between the lock and unlock aren't atomic if issued on the same connection but not in a tx.
Re:The pitfall of using PostgreSQL advisory locks with Go's ... by AlfeG on Sunday September 01, 2019 @01:41AM (#20850663)
For transactions You should use different advisory lock tied to transaction: pg_advisory_xact_lock. This should solve problem even for sessions reuse and connection pooling