Re: Recursive calls to functions that return sets - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Recursive calls to functions that return sets
Date
Msg-id 20001.1143063561@sss.pgh.pa.us
Whole thread Raw
In response to Re: Recursive calls to functions that return sets  (Thomas Hallgren <thomas@tada.se>)
List pgsql-hackers
Thomas Hallgren <thomas@tada.se> writes:
> But if I, during the SPI_IS_FIRST_CALL phase, do an SPI_connect 
> (done when the 'multi_call_memory_ctx' is current), then the leak seem 
> to occur immediately. Will that connect somehow alter the durability for 
> the context that is current on each call to my SRF?

Are you remembering to SPI_finish when you're done?  Maybe what you are
leaking is the SPI state information.

You could look at the MemoryContextStats printout for clues --- easiest
way is to deliberately run the backend out of memory, and after the "out
of memory" error occurs, look in the postmaster log.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Accessing schema data in information schema
Next
From: Hannu Krosing
Date:
Subject: Re: Accessing schema data in information schema