Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C68EF64FFB5 for ; Tue, 28 Oct 2008 17:13:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 76959-09 for ; Tue, 28 Oct 2008 17:13:01 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by postgresql.org (Postfix) with ESMTP id 2844564FFC0 for ; Tue, 28 Oct 2008 17:13:00 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id c7so1103853nfi.23 for ; Tue, 28 Oct 2008 13:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ad+w+mROHxKneABHPTsxBXQlkNd8wbyxx9Pi8zNBrCk=; b=pank+Zb8hfKgmGgFZEsvPedpqMxXbYd3DqkZB/L7JcFv3IveC4NM0WpPYKNIlGqLSV kZJ361GNg+JB1D79sCPtkBB0c/BemzaQN2LQ5Q/B2iSWqAewG+zzLQiCrSg6rX927Ol5 Phlsrjn64vXYUA8aJgUQ2M1P8pTprJ4OtRBGk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=uvBRggsqjwl0DRoQpSNV6mLsRvWaSOpkulN9KG/zxiWa8T3WT5vhdfoU49+JIUeJ8z cxSo2tA9kW1J3pTWEVVmRlwwGeG9whmtSjmng14VQh1wepqgeChMaagP8bZ+ADLVkp4z EWjf3DunAwOaVSj2hNeK5wTA7KHE8l2WxAmno= Received: by 10.187.166.4 with SMTP id t4mr738852fao.73.1225224779478; Tue, 28 Oct 2008 13:12:59 -0700 (PDT) Received: by 10.187.207.17 with HTTP; Tue, 28 Oct 2008 13:12:59 -0700 (PDT) Message-ID: <4dc28b160810281312m7f9c7635sf60502bef468a77b@mail.gmail.com> Date: Tue, 28 Oct 2008 15:12:59 -0500 From: "Joe Halpin" To: "Tom Lane" Subject: Re: Problem with trigger function in C Cc: pgsql-interfaces@postgresql.org In-Reply-To: <15986.1225224113@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4dc28b160810281234g1292831awf4b8716d64f7f405@mail.gmail.com> <15986.1225224113@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/14 X-Sequence-Number: 6815 Sorry I forgot to add that part. Here's how I did that: sn=# create function xqueryTrigger() returns trigger as '/usr/local/lib/postgresql/xqueryTrigger.so' language c; CREATE FUNCTION sn=# create trigger tbefore before insert or update on at_xparam for each row execute procedure xquerytrigger(); CREATE TRIGGER Is the function name case sensitive? I had originally named it xqueryTrigger, but after some error messages which referenced "xquerytrigger" I renamed it to be all lower case. Thanks Joe On Tue, Oct 28, 2008 at 3:01 PM, Tom Lane wrote: > "Joe Halpin" writes: >> I'm new at this and I apologize if I got the wrong list, but I'm >> trying to write a trigger function in C which is linked in with >> libxqilla and is supposed to run an xquery against some xml we have >> stored in a column. I find that when the function is entered fcinfo is >> null, which causes a segfault. > > AFAIK the only way fcinfo would be null is if PG didn't think that the > function was V1 call convention. I see that you do have the > PG_FUNCTION_INFO_V1 macro in there, which eliminates the most obvious > explanation. Are you sure that the SQL-level CREATE FUNCTION command > references this function name and not some other one? > > regards, tom lane >