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[4]: SPI_getvalue problem |
Date: | 2001-01-29 06:43:01 |
Message-ID: | 4404.010129@nlr.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Monday, January 29, 2001, 9:33:06 AM Tom wrote:
TL> Alex Guryanow <gav(at)nlr(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas T. Thai | 2001-01-29 06:44:51 | increase WAL_FILES |
Previous Message | Tom Lane | 2001-01-29 06:33:06 | Re: Re[2]: SPI_getvalue problem |