Re: BUG #6360: with hold cursor, cause function executed twice and wrong results
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #6360: with hold cursor, cause function executed twice and wrong results |
| Дата | |
| Msg-id | 11717.1325008040@sss.pgh.pa.us обсуждение |
| Ответ на | BUG #6360: with hold cursor, cause function executed twice and wrong results (wcting163@163.com) |
| Ответы |
Re: BUG #6360: with hold cursor, cause function executed
twice and wrong results
Re: BUG #6360: with hold cursor, cause function executed twice and wrong results |
| Список | pgsql-bugs |
wcting163@163.com writes:
> The reason is that the function p_test_execute is executed twice, when
> *fetch*, it is first executed, and when transaction commit, because the
> cursor is a *holdable* cursor, it is executed again.
Yup. I don't particularly see this as a bug. If you were to manually
rewind and rescan the cursor (ie, MOVE BACKWARD ALL and re-fetch),
the function would be executed multiple times too. If you don't want
that to happen, the best way would be to commit the transaction
immediately, not fetch some rows and then commit.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера