| От | Tom Lane |
|---|---|
| Тема | Re: Cursor not getting all rows |
| Дата | |
| Msg-id | 810.1116352586@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Cursor not getting all rows (Joseph Shraibman <jks@selectacast.net>) |
| Список | pgsql-general |
Joseph Shraibman <jks@selectacast.net> writes:
> I do this:
> BEGIN;
> SELECT count(*) FROM u, d WHERE u.id = d.id AND ... ;
> DECLARE cname CURSOR FOR SELECT u.field, d.field FROM u, d WHERE u.id =
> d.id AND ... ;
> At the end of the fetching if the number of fetched does not equal the
> number from the SELECT count(*) I print out a warning message. It
> happens every once in a while. Today it happened four times.
> How is this possible? Because they are in the same transaction the
> count and the cursor should see the exact same data, right?
Not unless you are using SERIALIZABLE mode --- otherwise the cursor will
see whatever changes were committed during execution of the first SELECT.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера