[HACKERS] Losing memory references - SRF + SPI

2016-05-13 Thread Anderson Carniel
I am writing a function that returns a set of tuples by using also the PostGIS. Thuis, I am using SRF too. It successfully returns the expected result when it has at most 4 tuples. However, this is not the case when more than 4 tuples have to be returned. When I debug the code, I found that the pro

Re: [HACKERS] Losing memory references - SRF + SPI

2016-05-14 Thread Joe Conway
On 05/13/2016 09:35 PM, Anderson Carniel wrote: > I am writing a function that returns a set of tuples by using also the > PostGIS. Thuis, I am using SRF too. It successfully returns the expected > result when it has at most 4 tuples. However, this is not the case when > more than 4 tuples have to

Re: [HACKERS] Losing memory references - SRF + SPI

2016-05-14 Thread Anderson Carniel
Thank you very much Joe. I have followed the crosstab() implementation and understood the idea of per query memory context. Now, I am using a unique SPI instance (which I perform several sql queries), process the result, transform my result into a tuplestore, close the SPI and done. It works perfe

Re: [HACKERS] Losing memory references - SRF + SPI

2016-05-14 Thread Michael Paquier
On Sun, May 15, 2016 at 10:22 AM, Anderson Carniel wrote: > Thank you very much Joe. > > I have followed the crosstab() implementation and understood the idea of per > query memory context. Now, I am using a unique SPI instance (which I perform > several sql queries), process the result, transform