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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general