| От | Glen Parker |
|---|---|
| Тема | Re: Locking to restrict rowcounts. |
| Дата | |
| Msg-id | 4A130807.5030703@nwlink.com обсуждение исходный текст |
| Ответ на | Re: Locking to restrict rowcounts. (Richard Huxton <dev@archonet.com>) |
| Список | pgsql-general |
Richard Huxton wrote: > Glen Parker wrote: >> Richard Huxton wrote: >> >> #3 won't work unless the other transactions have all committed by the >> time you do the check. It is guaranteed to fail at some point. > > If it's in an AFTER INSERT/UPDATE trigger then whatever transaction > takes you beyond 10 rows you will always get a failure. If you get a lot > of insert/delete pairings then you could spend a lot of time counting > rows, but that's all. I still don't think it will work. Two concurrent transactions could still screw the data up. Before: 9 rows. Tx 1: See 9 rows, issue insert, see 10 rows. Tx 2: See 9 rows, issue insert, see 10 rows. After: 11 rows. -Glen
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера