LibPQ: Lifetime of PGresult passed in to PQnoticeReceiver callback

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема LibPQ: Lifetime of PGresult passed in to PQnoticeReceiver callback
Дата
Msg-id CAFCRh--W80S=gdFB34Oqt1Nh9hhQffoFh4vincooVbRj-M8nEQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: LibPQ: Lifetime of PGresult passed in to PQnoticeReceiver callback  (Dominique Devienne <ddevienne@gmail.com>)
Re: LibPQ: Lifetime of PGresult passed in to PQnoticeReceiver callback  (Dmitry Igrishin <dmitigr@gmail.com>)
Список pgsql-general
Hi,

The doc at https://www.postgresql.org/docs/current/libpq-notice-processing.html is not clear to me on whether it should be PQclear'd or not. Who manages the lifetime of that PGresult?

Also, the "could be called as long as either the PGconn or PGresult exist" mention,
implies we do not need to clear the notice callback before PQfinish'ing the connection.
(and that does not seem possible, given passing in a NULL pointer is just a *get* it seems).
Is that correct?

Yet we are seeing our notice callback being called with an invalid PGresult (i.e. crash accessing it).
What could be the reasons for that? I'm assuming user-error in our code, but I don't see why yet.

Thanks for any insights. --DD

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

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Postgresql + containerization possible use case
Следующее
От: Rainer Duffner
Дата:
Сообщение: Re: Postgresql + containerization possible use case