Re: SPI_finish and RegisterExprContextCallback

From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SPI_finish and RegisterExprContextCallback
Date: 2005-02-18 16:58:32
Message-ID: thhal-0O7fxAmWlxic3a2eD4mr6vuqtSwG+mi@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom,

>You're right, you can't just return from that inner function while
>leaving its SPI connection open.
>
>It might be interesting to redesign SPI around the notion of independent
>"connection objects" rather than necessarily having a stack of 'em.
>
>
I made the same reflection looking at the SPI code. It would be nice if
something corresponding to _SPI_current could be passed around.

>I think that could be made to work ... but not while preserving the
>existing SPI API.
>
I'm not so sure you'd have to. A public API that can disable stack
handling and instead use something similar to MemoryContextSwitchTo but
for an _SPI_current like structure would perhaps be sufficient?

> I'm hesitant to break a ton of user-written code for
>a feature that only one person has needed :-(
>
>
It is a fairly serious design flaw IMHO. I discovered it and so far no
one else has complained. That's true for all flaws at first.

Regards,
Thomas Hallgren

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-02-18 17:10:09 Re: Data loss, vacuum, transaction wrap-around
Previous Message Tom Lane 2005-02-18 16:33:24 Re: SPI_finish and RegisterExprContextCallback