Re: libpq: how to get a sequence of partial PGresult-s

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: libpq: how to get a sequence of partial PGresult-s
Дата
Msg-id 23995.1064356049@sss.pgh.pa.us
обсуждение исходный текст
Ответ на libpq: how to get a sequence of partial PGresult-s  (Igor Shevchenko <igor@carcass.ath.cx>)
Ответы Re: libpq: how to get a sequence of partial PGresult-s  (Igor Shevchenko <igor@carcass.ath.cx>)
Список pgsql-interfaces
Igor Shevchenko <igor@carcass.ath.cx> writes:
> Is there any way to get/process this partial PGresult in my 
> app ? I haven't found any API function for this, so I thought about an 
> additional function for the libpq's API -
> PGresult* PQgetNextResult ( PGconn* conn );

I think this is a really bad idea, because it destroys libpq's basic
concept that you get either success or failure for a command.  Peeking
at a partially-arrived result might give you back some rows only to get
an error later (since the backend may fail partway through a query).

I'm not sure that the partially constructed result is valid anyway;
the last row may be in a funny state.  And what happens if the
application does a PQclear() on it??
        regards, tom lane


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

Предыдущее
От: Igor Shevchenko
Дата:
Сообщение: libpq: how to get a sequence of partial PGresult-s
Следующее
От: Igor Shevchenko
Дата:
Сообщение: Re: libpq: how to get a sequence of partial PGresult-s