Re: Recursive calls to functions that return sets

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Hallgren <thomas(at)tada(dot)se>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Recursive calls to functions that return sets
Date: 2006-03-22 21:39:21
Message-ID: 20001.1143063561@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Hallgren <thomas(at)tada(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2006-03-22 22:10:54 Re: Accessing schema data in information schema
Previous Message Alex bahdushka 2006-03-22 21:17:38 Re: PANIC: heap_update_redo: no block