Re: allowing multiple PQclear() calls

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
Cc: Marko Kreen <markokr(at)gmail(dot)com>, Josh Kupershmidt <schmiddy(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: allowing multiple PQclear() calls
Date: 2012-12-11 15:09:05
Message-ID: CA+U5nML4jNyCGMfXZJ94p7NBxQkVsVL+LrWeS26dd1rVNboPxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11 December 2012 12:18, Boszormenyi Zoltan <zb(at)cybertec(dot)at> wrote:

>>> Such mechanism already exist - you just need to set
>>> your PGresult pointer to NULL after each PQclear().
>>
>> So why doesn't PQclear() do that?
>
>
> Because then PQclear() would need a ** not a *. Do you want its
> interface changed for 9.3 and break compatibility with previous versions?

No, but we should introduce a new public API call that is safer,
otherwise we get people continually re-inventing new private APIs that
Do the Right Thing, as the two other respondents have shown.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-12-11 15:21:15 Re: Commits 8de72b and 5457a1 (COPY FREEZE)
Previous Message Ibrar Ahmed 2012-12-11 15:07:18 Re: Review: create extension default_full_version