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 566F58BA10E for ; Thu, 10 Feb 2005 03:03:36 +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 65481-04 for ; Thu, 10 Feb 2005 03:03:18 +0000 (GMT) Received: from ensc.cpsc.ucalgary.ca (ensc.cpsc.ucalgary.ca [136.159.2.4]) by svr1.postgresql.org (Postfix) with ESMTP id 7D55A8B9C0E for ; Thu, 10 Feb 2005 03:02:47 +0000 (GMT) Received: from imgw1.cpsc.ucalgary.ca (imgw1 [136.159.5.9]) by ensc.cpsc.ucalgary.ca (8.12.11/8.12.11) with ESMTP id j1A32Nbj019663 for ; Wed, 9 Feb 2005 20:02:23 -0700 Received: from localhost (localhost [127.0.0.1]) by imgw1.cpsc.ucalgary.ca (8.13.3/8.12.11) with ESMTP id j1A32M1c011707 for ; Wed, 9 Feb 2005 20:02:22 -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 11600-01 for ; Wed, 9 Feb 2005 20:02:15 -0700 (MST) Received: from frost (frost [136.159.10.67]) by imgw1.cpsc.ucalgary.ca (8.13.3/8.13.1) with ESMTP id j1A325h8011664 for ; Wed, 9 Feb 2005 20:02:05 -0700 Date: Wed, 9 Feb 2005 20:02:05 -0700 (MST) From: Seamus Thomas Carroll X-X-Sender: carrolls@frost To: pgsql-interfaces@postgresql.org Subject: Help with adding C-Language Functions Message-ID: 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 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/29 X-Sequence-Number: 5274 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