SPI_getvalue gives a core dump

From: <vivek(at)staff(dot)ownmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: SPI_getvalue gives a core dump
Date: 2006-07-28 15:35:05
Message-ID: 200607281535.k6SFZ5EV014757@mail009.ownmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

I am using postgresql:-
PostgreSQL 8.0.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.4
I am trying to trigger a function on insert. I get the following error:-

LOG: statement: INSERT INTO ast_cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES ('2006-07-28 20:35:14','"15554216325" <15554216325>','15554216325','889','from_box', 'SIP/15554216325-5914','SIP/69.54.75.50-da64','Playback','vivek/myfile'| noanswer',3,0,'NO ANSWER',3,'0','1154099114.198','vivek'

LOG: statement: SELECT count(*) FROM ast_cdr
CONTEXT: SQL statement "SELECT count(*) FROM ast_cdr"
LOG: server process (PID 5561) was terminated by signal 11
LOG: terminating any other active server processes
WARNING: terminating connection because of crash of another server process
DETAIL: The postmaster has command
ed this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.

I tried executing this:-
SELECT count(*) FROM ast_cdr;
-[ RECORD 1 ]
count | 2

I dont know where am i going wrong. Here is the source.

TriggerData *trigdata = (TriggerData *) fcinfo->context;
TupleDesc tupdesc;
if (CALLED_AS_TRIGGER(fcinfo)) { ==================== it comes here and enters inside.
userfield=SPI_getvalue(trigdata->tg_trigtuple,tupdesc,17); ================== it fails here because i tried to get logs before this statement and it succeeded.

Please help this newbie.

With warm regards.

Vivek J. Joshi.

vivek(at)staff(dot)ownmail(dot)com
Trikon electronics Pvt. Ltd.

All science is either physics or stamp collecting.
-- Ernest Rutherford

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2006-07-28 16:07:25 Re: SPI_getvalue gives a core dump
Previous Message John DeSoi 2006-07-26 00:52:30 Re: How do I get started?