X-Original-To: pgsql-interfaces-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 314239FB270 for ; Fri, 28 Jul 2006 13:03:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 59093-02-3 for ; Fri, 28 Jul 2006 13:03:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail009.ownmail.com (unknown [203.199.110.93]) by postgresql.org (Postfix) with ESMTP id B79E39FB28F for ; Fri, 28 Jul 2006 13:03:18 -0300 (ADT) Received: (from domains@localhost) by mail009.ownmail.com (8.12.11/8.12.10) id k6SFZ5EV014757; Fri, 28 Jul 2006 21:05:05 +0530 Date: Fri, 28 Jul 2006 21:05:05 +0530 Message-Id: <200607281535.k6SFZ5EV014757@mail009.ownmail.com> X-Originating-IP: 203.199.110.93 Reply-To: From: To: pgsql-interfaces@postgresql.org Subject: SPI_getvalue gives a core dump MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.906 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, NO_REAL_NAME X-Spam-Level: ** Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200607/12 X-Sequence-Number: 6202 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