From: vivek@staff.ownmail.com
To: pgsql-interfaces@postgresql.org
Subject: SPI_getvalue gives a core dump
Date: Fri, 28 Jul 2006 21:05:05 +0530
Message-ID: <200607281535.k6SFZ5EV014757@mail009.ownmail.com> (raw)
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@staff.ownmail.com
Trikon electronics Pvt. Ltd.
All science is either physics or stamp collecting.
-- Ernest Rutherford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: vivek@staff.ownmail.com
Subject: Re: SPI_getvalue gives a core dump
In-Reply-To: <200607281535.k6SFZ5EV014757@mail009.ownmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox