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 NOWAIT option in SELECT FOR UPDATE queries #12654
Comments
As @kresho suggested that not all databases support this queries. I just want to add here details about "NOWAIT" options. NOWAIT: To avoid waiting for other transactions to release row locks, maybe we can use NOWAIT with SELECT ....... FOR UPDATE or SELECT ........ FOR SHARE locking read statement. A locking read that uses NOWAIT never waits to acquire a row lock. The query executes immediately, failing with an error if a requested row is locked. |
This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
Just poking on this thread that we have a use case where this functionality would be very useful. |
Seems like there are two ways to go about this:
For what it's worth, NO WAIT and SKIP LOCKED are also available in mysql 8.0, so this is no longer just a postgres thing. |
Ah, and just discovered in master that |
Ok, PR submitted. If there is support for it, I'll go ahead and get the website docs PR together. But will hold off on that until I confirm it's worth the time. |
Not all databases support this so it would be a dialect specific option. Postgres and Oracle do support it directly.
Mssql has a tablehint which could be covered with the standardised NOWAIT option.
Indicate your interest in the addition of this feature by adding the 👍 reaction. Comments such as "+1" will be removed.
The text was updated successfully, but these errors were encountered: