Skip site navigation (1) Skip section navigation (2)

Re: SRF's + SPI

From: Eric B(dot)Ridge <ebr(at)tcdi(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SRF's + SPI
Date: 2005-04-01 21:29:31
Message-ID: ff26db683bac193e7fb83c5e058700d6@tcdi.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Apr 1, 2005, at 3:55 PM, Tom Lane wrote:

> "Eric B.Ridge" <ebr(at)tcdi(dot)com> writes:
>> Like I said, everything
>> usually works without problems, but from time to time it crashes.
>
> If you rebuild with --enable-cassert, does the crash get more
> reproducible?

Indeed.  Every time.  This is now the default for my development 
environment.

> I'm also pretty uncomfortable with the fact that you're returning out
> of your function while still connected to SPI.  That would certainly
> cause problems for anything else trying to use SPI in the same query.

Ditto.  I knew this while writing the code but didn't see any other way 
to handle it.

The tuplestore stuff sounds like the right solution, but in the 
interests of providing a quick patch to my production environment does 
it makes sense to make a copy of the SPI_tuptable during the first-call 
of the SRF (allocated in the SRF's memory context of course)?

I need to look into what plpgsql does with the tuplestore business but 
I suppose it knows how to spill to disk and such.  In the end, that's 
what I'd want, but I think it'll take me more than an hour to write 
that code.

Thanks for your time and help.

eric


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-04-01 21:56:44
Subject: Re: SRF's + SPI
Previous:From: Tom LaneDate: 2005-04-01 20:55:47
Subject: Re: SRF's + SPI

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group