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 68EA38B9F00 for ; Thu, 10 Feb 2005 08:21:52 +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 23691-01 for ; Thu, 10 Feb 2005 08:21:35 +0000 (GMT) Received: from ensa.cpsc.ucalgary.ca (ensa.cpsc.ucalgary.ca [136.159.2.1]) by svr1.postgresql.org (Postfix) with ESMTP id 09BD28B9C8D for ; Thu, 10 Feb 2005 08:21:36 +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 j1A8HhdW026317 for ; Thu, 10 Feb 2005 01:17:43 -0700 Received: from localhost (localhost [127.0.0.1]) by imgw1.cpsc.ucalgary.ca (8.13.3/8.12.11) with ESMTP id j1A8HhMf020250 for ; Thu, 10 Feb 2005 01:17:43 -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 19753-03 for ; Thu, 10 Feb 2005 01:17:36 -0700 (MST) Received: from frost (frost [136.159.10.67]) by imgw1.cpsc.ucalgary.ca (8.13.3/8.13.1) with ESMTP id j1A8HFCD020224 for ; Thu, 10 Feb 2005 01:17:15 -0700 Date: Thu, 10 Feb 2005 01:17:14 -0700 (MST) From: Seamus Thomas Carroll X-X-Sender: carrolls@frost To: pgsql-interfaces@postgresql.org Subject: Re: Help with adding C-Language Functions In-Reply-To: Message-ID: References: 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.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/30 X-Sequence-Number: 5275 I changed my file from BlackboardFunctions.c to all lowercase, blackboardfunctions.c, and the database now finds the add_one function. Crazy. Can someone explain the reason why this happened? Is this a linker issue or something in postgresql. Seamus On Wed, 9 Feb 2005, Seamus Thomas Carroll wrote: > Hi, > > I am trying to add a C-Language Function. I have created a small example in > file BlackboardFunctions.c. > > #include > #include > > PG_FUNCTION_INFO_V1(add_one); > > Datum > add_one(PG_FUNCTION_ARGS) > { > int32 arg = PG_GETARG_INT32(0); > > PG_RETURN_INT32(arg + 1); > } > > The make file: > make: > cc -fpic -c BlackboardFunctions.c -I > /home/grads/carrolls/source/postgresql-7.4.5/src/include/ > cc -shared -o BlackboardFunctions.so BlackboardFunctions.o > > Everything compiles nicely and when i try to add the function using: > Blackboard=# CREATE FUNCTION add_one(integer) RETURNS integer > Blackboard-# AS > '/home/grads/carrolls/gradstudies/implementation/BlackboardFunctions/BlackboardFunctions', > 'add_one' > Blackboard-# LANGUAGE C STRICT; > > I get the following error: > ERROR: could not find function "add_one" in file > "/home/grads/carrolls/gradstudies/implementation/BlackboardFunctions/BlackboardFunctions.so" > > A grep of BlackboardFunction.so finds add_one. > I figure i must be doing something obviously wrong but for the life of me i > cant figure out what that might bt. Can anyone recommend a course of action? > > Thank you, > > Seamus > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >