Re: allowing multiple PQclear() calls

From: Marko Kreen <markokr(at)gmail(dot)com>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: allowing multiple PQclear() calls
Date: 2012-12-11 10:39:42
Message-ID: CACMqXCJVVJ_6WsOM-mo5h4tL=wYiv-qKz0k_0O+SuFhLsbp-qQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 11, 2012 at 6:59 AM, Josh Kupershmidt <schmiddy(at)gmail(dot)com> wrote:
> Would it be crazy to add an "already_freed" flag to the pg_result
> struct which PQclear() would set, or some equivalent safety mechanism,
> to avoid this hassle for users?

Such mechanism already exist - you just need to set
your PGresult pointer to NULL after each PQclear().

Later you can safely call PQclear() again on that pointer.

--
marko

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2012-12-11 10:47:54 Re: Proposal for Allow postgresql.conf values to be changed via SQL
Previous Message Jeevan Chalke 2012-12-11 09:23:36 Re: too much pgbench init output