X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7BE8F8B9EFE for ; Thu, 10 Feb 2005 19:57:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94053-10 for ; Thu, 10 Feb 2005 19:56:51 +0000 (GMT) Received: from ensa.cpsc.ucalgary.ca (ensa.cpsc.ucalgary.ca [136.159.2.1]) by svr1.postgresql.org (Postfix) with ESMTP id ACCB38BA039 for ; Thu, 10 Feb 2005 19:56:51 +0000 (GMT) Received: from imgw1.cpsc.ucalgary.ca (imgw1 [136.159.5.9]) by ensa.cpsc.ucalgary.ca (8.12.11/8.12.11) with ESMTP id j1AJtqTD030991; Thu, 10 Feb 2005 12:55:52 -0700 Received: from localhost (localhost [127.0.0.1]) by imgw1.cpsc.ucalgary.ca (8.13.3/8.12.11) with ESMTP id j1AJtqR5011145; Thu, 10 Feb 2005 12:55:52 -0700 Received: from imgw1.cpsc.ucalgary.ca ([127.0.0.1]) by localhost (imgw1 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10830-04; Thu, 10 Feb 2005 12:55:45 -0700 (MST) Received: from frost (frost [136.159.10.67]) by imgw1.cpsc.ucalgary.ca (8.13.3/8.13.1) with ESMTP id j1AJti8v011137; Thu, 10 Feb 2005 12:55:44 -0700 Date: Thu, 10 Feb 2005 12:55:44 -0700 (MST) From: Seamus Thomas Carroll X-X-Sender: carrolls@frost To: Tom Lane Cc: pgsql-interfaces@postgresql.org Subject: Re: Help with adding C-Language Functions In-Reply-To: <27779.1108056673@sss.pgh.pa.us> Message-ID: References: <27779.1108056673@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at cpsc.ucalgary.ca X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/39 X-Sequence-Number: 5284 Thinking back I think i tried g++ first which caused the error to occur. When i then tried cc the .so was already loaded. I have c++ classes i want to use but when i complile using g++ i get the error (cant find function x in file.so). Does anyone have experience compiling c++ and loading the function? Seamus On Thu, 10 Feb 2005, Tom Lane wrote: > Seamus Thomas Carroll writes: >> I changed my file from BlackboardFunctions.c to all lowercase, >> blackboardfunctions.c, and the database now finds the add_one function. > > I'm betting that the actual sequence of events was more like this: > > CREATE FUNCTION f1(...) as '/home/.../BlackboardFunctions' ...; > [ test f1, it works, cool ] > [ add add_one to C source file, recompile ] > CREATE FUNCTION add_one(...) as '/home/.../BlackboardFunctions' ...; > [ fails ] > [ rename file ] > CREATE FUNCTION add_one(...) as '/home/.../blackboardfunctions' ...; > [ works ] > > The reason the second try didn't work is that an existing backend will > not re-load an already loaded .so file, unless you force it to with the > LOAD command. It doesn't notice that you've modified the file. Had you > started a fresh session, things would have worked, too. > > regards, tom lane >