prepared statement results don't clear?

From: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: prepared statement results don't clear?
Date: 2006-01-17 20:37:14
Message-ID: 43CD557A.2090208@ll.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-01-17 20:59:45 Re: Rule problem: return value of insert
Previous Message Tino Wildenhain 2006-01-17 20:19:06 Re: Distance calculation