| От | Tom Lane |
|---|---|
| Тема | Re: move forward 0 from foo; |
| Дата | |
| Msg-id | 7253.1080081430@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | move forward 0 from foo; (Chester Kustarz <chester@arbor.net>) |
| Список | pgsql-sql |
Chester Kustarz <chester@arbor.net> writes:
> I expected "MOVE FORWARD 0 FROM foo;" to always return
> 0, but I have found this not to be the case.
You are misinterpreting the output. The result is the number of rows
that would have been returned by a FETCH with the same parameters.
FETCH 0 means "re-fetch current row" (don't blame us, this is per SQL
spec), and so it will return 1 row unless you are currently positioned
off the end of the result. Hence, MOVE 0 returns either 0 or 1
depending on whether you are currently on a row.
It looks like the MOVE documentation is a bit poorly worded; I'll do
something about that.
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера