Re[2]: SPI_getvalue problem

From: Alex Guryanow <gav(at)nlr(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re[2]: SPI_getvalue problem
Date: 2001-01-29 06:17:56
Message-ID: 5387.010129@nlr.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sunday, January 28, 2001, 8:24:51 PM Tom wrote:

TL> Alex Guryanow <gav(at)nlr(dot)ru> writes:
>> I have the following problem: the backend crashes on Solaris while
>> executing the function SPI_getvalue.
>> At the same time on Linux this trigger works fine.
>> Is this a bug or my misconfuguration?

TL> Sounds like a bug to me, but you haven't demonstrated that the bug is in
TL> SPI_getvalue and not in your own code. The first thing I'd wonder about
TL> is if your trigger function is checking for NULL value before calling
TL> SPI_getvalue (or at least before trying to do anything useful with the
TL> result).

You have right. One of the values passed to SPI_getvalue is NULL. This is second parameter
(tupdesc). But why on Linux it is not NULL, and on Solaris is?

Here is part of my trigger-code:

rel = CurrentTriggerData->tg_relation;
trigtuple = CurrentTriggerData->tg_trigtuple;
newtuple = CurrentTriggerData->tg_newtuple;
tupdesc = rel->rd_att;

elog(DEBUG, "before 1 SPI");
elog(DEBUG, "triggered for relation %s", SPI_getrelname(CurrentTriggerData->tg_relation) );
id = atoi( SPI_getvalue( trigtuple, tupdesc, 1 ) );
elog( DEBUG, "before 1.5 SPI" ); // !!! this isn't called in Solaris

Best regards,
Alex

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas T. Thai 2001-01-29 06:31:35 while vacuum: pq_flush: send() failed: Broken pipe
Previous Message George Johnson 2001-01-28 23:36:43 RE: jdbc, use of nested ResultSet loops.(longish, interesting I hope)