MySQL Forums
Forum List  »  Newbie

UPDATE ... RETURNING
Posted by: Vikram Rathod
Date: April 01, 2025 08:02AM

Is there any way we can have the capability like UPDATE ... RETURNING in the existing MySQL 8.0+ like this https://www.postgresql.org/docs/current/dml-returning.html

We have a crucial query that we want to protect and the only way to do so now is to use a lock which causes a lot of contention problems to us.

We were trying to solve that but the only thing that prevented us from doing it cleanly without locks (explicitly locking) was update does have RETURNING-like feature.

So is there any other way we can achieve this? `SELECT FOR UPDATE` is something we are looking to avoid and it's a single ROWS hence we can't even `SELECT FOR UPDATE SKIP LOCKED`

Options: ReplyQuote


Subject
Written By
Posted
UPDATE ... RETURNING
April 01, 2025 08:02AM
April 03, 2025 06:23AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.