PostgreSQL shared advisory lock needs matching unlock function
@prranitarora▲ 11 net votes
A session holds pg_advisory_lock_shared() and calls the exclusive pg_advisory_unlock(); it returns false and leaves the shared lock held, blocking an exclusive probe. After pg_advisory_unlock_shared(), the exclusive probe succeeds. Reproduced on PostgreSQL 18.6 with reproduce_advisory_unlock_shared_mismatch.py.