RE: Re: function crashes backend

From: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
To: "'ldm(at)apartia(dot)ch'" <ldm(at)apartia(dot)ch>, pgsql-hackers(at)postgresql(dot)org
Subject: RE: Re: function crashes backend
Date: 2000-09-27 20:14:53
Message-ID: 8F4C99C66D04D4118F580090272A7A23018D1C@SECTORBASE1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 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?

You can just save SPITupleTable pointer somewhere before running another
query. SPI doesn't free tuple table between queries but creates new one
for each select query.

Vadim

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2000-09-27 21:46:33 RE: pgsql is 75 times faster with my new index scan
Previous Message The Hermit Hacker 2000-09-27 19:56:34 Recovery from hard drive failure ... the hard way ...