Re: [HACKERS] SPI_exec doesn't return proc context (on 9.1)

2011-02-10 Thread Tom Lane
Alvaro Herrera writes: > I wrote such a patch some time ago but never applied it ... > http://archives.postgresql.org/message-id/20091116162531.ga3...@alvh.no-ip.org > I still wonder if it's useful enough to be applied. Would it solve your > use case? Needs to be fixed to behave sanely for the t

Re: [HACKERS] SPI_exec doesn't return proc context (on 9.1)

2011-02-10 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of sáb ene 29 16:56:40 -0300 2011: > 2011/1/29 Tom Lane : > > The less crocky way to do that is to use SPI_palloc() for something that > > should be allocated in the outer context. > > I understand. Is there some way, where I can use a cstring_to_text > funct

Re: [HACKERS] SPI_exec doesn't return proc context (on 9.1)

2011-01-29 Thread Pavel Stehule
2011/1/29 Tom Lane : > Pavel Stehule writes: >> I am playing with demos for PostgreSQL's Prague Developer Day and I >> found a strange behave. SPI_exec should to return to proc context. But >> it isn't true. > > Yes it is. ah, I though a savedctx, but it restore procctx, that is child context of

Re: [HACKERS] SPI_exec doesn't return proc context (on 9.1)

2011-01-29 Thread Tom Lane
Pavel Stehule writes: > I am playing with demos for PostgreSQL's Prague Developer Day and I > found a strange behave. SPI_exec should to return to proc context. But > it isn't true. Yes it is. > In following demo, I have to play with MemoryContext > when I would to get a correct result. Is it ok

[HACKERS] SPI_exec doesn't return proc context (on 9.1)

2011-01-29 Thread Pavel Stehule
Hello I am playing with demos for PostgreSQL's Prague Developer Day and I found a strange behave. SPI_exec should to return to proc context. But it isn't true. In following demo, I have to play with MemoryContext when I would to get a correct result. Is it ok? /* * contrib/citext/p2d2.c */ #inc