Answer the question
In order to leave comments, you need to log in
How to make RETURNING id with lock?
When inserting data into the database, an ID is returned using the built-in function RETURNING id;
But it turned out that about 50 people inserted the record at once. And accordingly, the ID of the one who last inserted the record was returned to half.
This is probably an isolated case. But the confidential material was received by another person.
How can this be fixed? How to return the ID of only the person who inserted the entry, and not the last entry?
Example:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question