prepared statement results don't clear? - Mailing list pgsql-general

From David Rysdam
Subject prepared statement results don't clear?
Date
Msg-id 43CD557A.2090208@ll.mit.edu
Whole thread Raw
Responses Re: prepared statement results don't clear?
List pgsql-general
I have a Tcl function that does this:

1) create prepared statement for binary insertion via pg_exec (and
releases the result handle)
2) run statement with binary data via pg_exec_prepared (and releases the
result handle)
3) deallocate statement via pg_exec (and releases the result handle)

When I try to run this function a couple hundred times, I get "had limit
on result handles reached" after 128 successes.  It seems something is
not being released.  To make absolutely sure it's not me that's leaving
something out there, I output a line each time I either create or
destroy a result handle and they add up perfectly.  Furthermore, all the
pg_execs go through another function that has been well-exercised, so I
don't think the problem is there.

The only thing I can think of is that a prepared statement (or the Tcl
specific pg_exec_prepared) has, like, a "double" result handle (one for
the statement itself and one for the exec'ing thereof).  Kind of a
half-assed theory, but necessity is the mother of such invention.  Does
anyone else have any better ideas for locating the result handle leak?


pgsql-general by date:

Previous
From: Tino Wildenhain
Date:
Subject: Re: Distance calculation
Next
From: Tom Lane
Date:
Subject: Re: Rule problem: return value of insert