Re[2]: SPI_getvalue problem - Mailing list pgsql-general

From Alex Guryanow
Subject Re[2]: SPI_getvalue problem
Date
Msg-id 5387.010129@nlr.ru
Whole thread Raw
In response to Re: SPI_getvalue problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re[2]: SPI_getvalue problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Sunday, January 28, 2001, 8:24:51 PM Tom wrote:

TL> Alex Guryanow <gav@nlr.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



pgsql-general by date:

Previous
From: "George Johnson"
Date:
Subject: RE: jdbc, use of nested ResultSet loops.(longish, interesting I hope)
Next
From: "Thomas T. Thai"
Date:
Subject: while vacuum: pq_flush: send() failed: Broken pipe