Re: Find out the number of rows returned by refcursor?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Find out the number of rows returned by refcursor?
Дата
Msg-id 14743.1160676889@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Find out the number of rows returned by refcursor?  ("Karen Hill" <karen_hill22@yahoo.com>)
Список pgsql-general
"Karen Hill" <karen_hill22@yahoo.com> writes:
>> Cool.  Quick question, how does one go about noting the rowcount?
>> Using the rowcount in get diagnostics or something else?

> A  "MOVE FORWARD ALL FROM cur;" statement returns "MOVE x". Where x is
> the number moved.  The result seems to be of a NOTICE type, and I'm not
> sure how I can pass that as a result from a pgsql function.

Um ... sorry, you can't really.  I was thinking of doing this from
client-side logic, where that count is normally going to be accessible
as part of the command status.  plpgsql has a pretty limited set of
cursor features --- I don't think it lets you get at MOVE ALL at all,
let alone check the number of rows moved over.  Can you push the
operation over to the client side?

(We ought to try to improve that situation in future releases, but that
won't help you today.)

            regards, tom lane

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

Предыдущее
От: "Karen Hill"
Дата:
Сообщение: Re: Find out the number of rows returned by refcursor?
Следующее
От: brian
Дата:
Сообщение: some log statements ignored