leon.p.smith at gmail.com
Sat Jun 9 00:28:45 CEST 2012
You don't need to; PGclear is called automatically some time after the
Result is garbage collected. This is done by using PQclear as a finalizer
on the foreign pointer that represents a Result:
There is "unsafeFreeResult", which triggers the finalizer at a
deterministic point in time. But I don't recommend it's use unless you
really understand the basics of GHC's implementation : you can easily have
a reference to the Result sitting around in a thunk even "after" you have
computed some value from the Result and thrown away all other references.
(Because, in fact, you haven't computed the value completely; some part
of that value is actually a thunk that needs the Result to compute the rest
of the value.) And even then, I'm skeptical that very many
applications would truly benefit from it's use.
On Fri, Jun 8, 2012 at 3:03 PM, Kirk Peterson <necrobious at gmail.com> wrote:
> Hi Leon,
> I'm working with your haskell postgresql-libpq package and noticed
> that the examples form:
> release a Result using the PGclear() function, however there is no
> clear function in postgresql-libpq.
> I'm new to libpq in general, so perhaps this is an easy question: what
> is the idiomatic way to clear a result using postgresql-libpq?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the database-devel