Re: allowing multiple PQclear() calls

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
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: 2013-01-02 15:11:49
Message-ID: 50E44E35.40900@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012-12-11 16:09 keltezéssel, Simon Riggs írta:
> 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.
>

How about these macros?

Best regards,
Zoltán Böszörményi

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/

Attachment Content-Type Size
pqclear-pqfinish-set-null.patch text/x-patch 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2013-01-02 15:27:15 Re: allowing multiple PQclear() calls
Previous Message Claudio Freire 2013-01-02 14:32:50 Re: default SSL compression (was: libpq compression)