-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support pg_advisory_lock_shared
#3758
Comments
There isn't really any reason we don't besides YAGNI/scope creep. This is the first time anyone has explicitly requested this support.
I'd prefer it to match the functions in Postgres. They use unsuffixed names for exclusive locks and the |
It also just occurred to me that we could also support transaction-scoped locks if we wanted to. They would take |
Yea I see it as an alternative to explicit table locking which would potentially avoid the lifetime that But I've also written the equivalent code that does carry the lifetime, and it's not terrible. So I mostly saw this as a relatively easy feature to add. But not something urgent.
Interesting. So you mean you would just call |
Yes, though I think the methods would be more discoverable if they were on |
I have found these related issues/pull requests
Relates to #3495
Description
As documented here.
The
PgAdvisoryLock
documentation has some language suggesting that the API should support shared locking, but it does not currently support it.Prefered solution
I'm guessing we just need separate
acquire_shared
andacquire_exclusive
methods onPgAdvisoryLock
.Should be compatible with #3495
Is this a breaking change? Why or why not?
Depends. I'd like to have an explicitly named
acquire_exclusive
method, which is different from the currentacquire
name. We could just deprecate the old one.But #3495 is breaking, and I'd prefer to have that merged first.
The text was updated successfully, but these errors were encountered: