Skip to content

Tag: locking

waitlist in postgres, deadlock

I’m trying to create a waiting list in Postgres. Minimal code: status is important, because I want to be able to notify users when they are applied after waitlisted. But don’t want to notify them based on that they are in the first n position if they wasn’t waitlisted at all. Services are limited to a given number of users.

postgresql “idle in transaction” with all locks granted

A very simple delete (by key) on a small table (700 rows) every now and then stays “idle in transaction” for minutes (takes milliseconds usually) even though all the locks are marked as “granted”. What can I do to pinpoint what causes it? I’m using this select: which shows a lot of “RowExclusiveLock”s but all are granted… so I don’t