Re: full tuple count in cursor.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: full tuple count in cursor.
Дата
Msg-id 14660.1084189450@sss.pgh.pa.us
обсуждение исходный текст
Ответ на full tuple count in cursor.  (Alexander Cohen <alex@toomuchspace.com>)
Список pgsql-general
Alexander Cohen <alex@toomuchspace.com> writes:
> I have a cursor that i got from a select statement. I would like to
> know how many records are in the cursor so i dont go over the last one
> when using FETCH on the cursor. How can i do this?

You can't.  The system does not know how many rows will be in the query
until it executes it.  So the only way to obtain this information is to
FETCH the data.  (Or MOVE over it, but that's only marginally faster,
and is probably a dead loss if you intend to FETCH the data anyway
later.)

            regards, tom lane

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

Предыдущее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: passing strings to functions
Следующее
От: Shridhar Daithankar
Дата:
Сообщение: Re: Cancel query based on a timeout