Re: LibPQ: Lifetime of PGresult passed in to PQnoticeReceiver callback

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: LibPQ: Lifetime of PGresult passed in to PQnoticeReceiver callback
Date: 2021-12-14 09:39:42
Message-ID: CAFCRh-971bjYCb3NYWaAYSscDJXnZTVc=24gW8AOaZnRLCrQFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi again. Is this not the right ML?
Which PostgreSQL ML should this question be asked to, to have a chance to
get an answer?
I'm new to this particular ML, and I'm surprised by the silence. Thanks,
--DD

On Mon, Dec 13, 2021 at 9:46 AM Dominique Devienne <ddevienne(at)gmail(dot)com>
wrote:

> 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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dmitry Igrishin 2021-12-14 10:28:53 Re: LibPQ: Lifetime of PGresult passed in to PQnoticeReceiver callback
Previous Message Klaudie Willis 2021-12-14 08:16:08 Re: When Update balloons memory