Ernst-Georg Schmid <pgchem@tuschehund.de> writes:
> I have still a follow-up question, though. Since I'm not calling
> SPI_freeplan(), the cached plan lives forever, right?
Till the per-session server process exits. I wouldn't call it
a leak as long as you can reuse the plan in later calls in that
session; a static variable's scope is fine for that.
regards, tom lane