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 484119FB1E0 for ; Mon, 31 Jul 2006 09:54:11 -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 85104-02 for ; Mon, 31 Jul 2006 09:53:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 1F0029FB319 for ; Mon, 31 Jul 2006 09:53:12 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k6VCqrh1024584 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 31 Jul 2006 06:52:55 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k6VCqqUp064000; Mon, 31 Jul 2006 06:52:52 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k6VCqqwE063999; Mon, 31 Jul 2006 06:52:52 -0600 (MDT) (envelope-from mfuhr) Date: Mon, 31 Jul 2006 06:52:52 -0600 From: Michael Fuhr To: vivek@staff.ownmail.com Cc: pgsql-interfaces@postgresql.org Subject: Re: SPI_getvalue fails Message-ID: <20060731125252.GA63949@winnie.fuhr.org> References: <200607310659.k6V6xP8N027369@mail009.ownmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200607310659.k6V6xP8N027369@mail009.ownmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.051 tagged_above=0 required=5 tests=AWL, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: ** X-Archive-Number: 200607/19 X-Sequence-Number: 6209 On Mon, Jul 31, 2006 at 12:29:25PM +0530, vivek@staff.ownmail.com wrote: > I get a coredump if I try to use SPI_getvalue. Upon writing some > logs, I see that postgresql gets the insert statement properly > with all the values non null but the variable trigdata->tg_trigtuple > is NULL. I am not able to figure out why it happens so. The connection between trigdata->tg_trigtuple being NULL and SPI_getvalue() causing a core dump isn't clear from what you've written. It sounds like you're writing a C function that's called via a trigger -- is that correct? Could you post the CREATE TRIGGER statement and the function's code? -- Michael Fuhr