Re: Does a the block of code within a stored procedure constitute
В списке pgsql-sql по дате отправления:
| От | Rod Taylor |
|---|---|
| Тема | Re: Does a the block of code within a stored procedure constitute |
| Дата | |
| Msg-id | 1059698237.33557.8.camel@jester обсуждение исходный текст |
| Ответ на | Does a the block of code within a stored procedure constitute a transaction? (<btober@seaworthysys.com>) |
| Ответы |
Re: Does a the block of code within a stored procedure constitute a transaction?
|
| Список | pgsql-sql |
> What I need to know is whether or not this is multi-user safe, i.e., will > the block of code in the procedure execute as a transaction so that if > more than one clerk creates an expense report for the same employee > simultaneously is it possible or impossible that value of the > employee.expense_report_seq gets updated by the second clerk between the > SELECT and UPDATE statements invoked by the first clerk? > > And as a follow-up, should I add the FOR UPDATE clause to the SELECT > statement? SELECT .. FOR UPDATE would be appropriate. However, you could also do an update + 1 first and the select second to find what you changed the value to.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера