Monday, January 29, 2001, 9:33:06 AM Tom wrote:
TL> Alex Guryanow <gav@nlr.ru> writes:
>> 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
TL> Are you sure that rel->rd_att is null? That seems extremely improbable.
I have added the followind code after
tupdesc = rel->rd_att; // (see above)
if( tupdesc == NULL || trigtuple == NULL ){
elog( DEBUG, "tupdesc OR trigtuple == NULL" );
if( tupdesc == NULL )
elog( DEBUG, "tupdesc is NULL" );
if( trigtuple == NULL )
elog( DEBUG, "trigtuple is NULL" );
}
else
elog( DEBUG, "tupdesc && trigtuple ARE NOT NULL" );
And here is what I see in my postmaster.log:
DEBUG: tupdesc OR trigtuple == NULL
DEBUG: tupdesc is NULL
DEBUG: before 1 SPI
DEBUG: triggered for relation magazine
Server process (pid 925) exited with status 139 at Mon Jan 29 08:59:23 2001
Terminating any active server processes...
Server processes were terminated at Mon Jan 29 08:59:23 2001
Reinitializing shared memory and semaphores
On Linux instead first two lines log contains
DEBUG: tupdesc && trigtuple ARE NOT NULL
Best regards,
Alex