Re: FETCH FORWARD 0 and "cursor can only scan forward" error

Поиск
Список
Период
Сортировка
От Trigve
Тема Re: FETCH FORWARD 0 and "cursor can only scan forward" error
Дата
Msg-id loom.20130905T071803-926@post.gmane.org
обсуждение исходный текст
Ответ на FETCH FORWARD 0 and "cursor can only scan forward" error  (Trigve Siver <trigves@yahoo.com>)
Список pgsql-general
David Johnston <polobo <at> yahoo.com> writes:

>
> Trigve Siver wrote
> > I want to iterate all records with cursor from beginning to end. This
> > sample could be rewritten using FETCH FORWARD 1 ... without using MOVE but
> > I'm interested with solution which throws error.
>
> Is you interest purely academic or is there some reason you were evaluating
> this particular combination of commands?

I was just using this command in some iterator code where I only fetched the
row on iterator dereferencing. So wanted to have solo operation for "move"
and for "fetch" command.

> I find the fact that the implementation detail behind "FORWARD 0" causing it
> to only be useful in a scroll-able cursor to be unusual but lacking any
> concrete use-cases as to why "FORWARD 0" is nominally useful - let alone in
> a scroll-forward-only situation - convincing someone to change the behavior
> is difficult.
> [...]
>
> Any comments on why it shouldn't work in a scroll-forward only situation.
> Re-returning the same row again may technically be considered "re-visiting
> the same record" which is what is being disallowed but if "0" is
> special-cased anyway it shouldn't be that difficult to return a cached
> result of whatever last came out of the cursor.  Not sure its worth the time
> to code and test but is there some philosophical (or standards-based) reason
> such an action should be prohibited?

I agree with you and was asking the same question in mind when writing the
first message.

> David J.
>

Trigve

В списке pgsql-general по дате отправления:

Предыдущее
От: M Tarkeshwar Rao
Дата:
Сообщение: Can you please suggest me some links where I can learn:
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Can you please suggest me some links where I can learn: