On Wed, Sep 27, 2000 at 08:53:58AM +0200, Louis-David Mitterrand wrote:
> Hello,
>
> I am writing a SPI function to run maintenance tasks on my auction
> system but it keeps crashing the backend after running only one loop.
> Now, I am not a C programmer, nor do I have any formal training in CS. I
> thought I might run this function by you guys so that a cursory look
> might reveal some obvious coding mistake?
>
> Thanks in advance for your insight.
Following up to myself, I finally understood my problem: I was trying to
re-use SPI_tuptable->vals[i] after calling SPI_exec() on another,
unrelated query. So the backend crash makes perfect sense now.
What is the best strategy:
- store the result of a SELECT returning multiple tuples into a local SPITupleTable? How do I allocate memory for
that?
- iterate over all values contained in the tuples and store _them_ into char**, int*, arrays, before re-running
SPI_exec()on the second query?
TIA
--
Louis-David Mitterrand - ldm@apartia.org - http://www.apartia.org
> Any suggestions for setting up WinCVS client + (server) on NT4?
Run away screaming in terror. --Toby.