Cursor queries & fetches

Поиск
Список
Период
Сортировка
От Steve Howe
Тема Cursor queries & fetches
Дата
Msg-id 9kg6d1$1i69$1@news.tht.net
обсуждение исходный текст
Список pgsql-hackers
Hello all,
       I've noted that the MOVE command won't send you an error message if
you try to position the cursor AFTER the actual end of the records. Is this
ok ??? I think it should return a proper error code and message, but
instead, it will return only an empty recordset.

The following code will demonstrate what I mean:

rollback;begin;declare Test cursor for select typname from pg_type;move
10000 in Test;fetch 10 in Test;close Test;end;

I think 'move 10000' should raise an error...
Any comments ?
Does Oracle or other DBMSs act like this ?

I have another questions, since I can't find answers anywhere on the
documentation...
1) can DECLARE be modified to return the number of rows in the resultset,
maybe by adding some new parameter ?... Or it would it require to execute
the whole query before returning this value ?...
2) How does cursor queries really work: they execute the query, store all
rows in memory, and then pass small resultsets retrieved by FETCH commands
on the client, or does it produces and retrieves each recorset as each FETCH
command is issued ??

Best Regards,
Steve Howe




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

Предыдущее
От: Giles Lean
Дата:
Сообщение: Re: SIGCHLD handler in Postgres C function.
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: patch for contrib/intarray (current CVS)