PGSQL 6.4 and C++ Functions

From: Sven Hartrumpf <Sven(dot)Hartrumpf(at)FernUni-Hagen(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: PGSQL 6.4 and C++ Functions
Date: 1998-11-13 07:56:16
Message-ID: 13899.57300.351133.806303@ki30
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi everyone!

I need to use Programming Language Functions (see chapter 4, of the
PostgreSQL Programmer's Guide) written in C++.
I managed to get a some examples written in C running (under Solaris 2.6,
gcc 2.8.1), but I failed with C++.

This create command is successful:

create function newer(entry, int2, int2, int2) returns bool as '/pgsql/methods.so' LANGUAGE 'c';

But when I use the function in a SQL query I get the following error:

ERROR: Can't find function newer in file /home/sven/my/pgsql/methods.so

This is how I compiled the C++ source code:

methods.o: methods.c
g++ -I/usr/local/pgsql/include -c -fPIC $< -o $@

methods.so: methods.o
g++ -shared -o $@ $<

Any help or any working examples?

Sven

------------------------------------------------------------------------------
Sven Hartrumpf e-mail: Sven(dot)Hartrumpf(at)FernUni-Hagen(dot)de
Computer Science VII (AI) phone: +49 2331 987 4553
University of Hagen fax: +49 2331 987 392
58084 Hagen - Germany http://www.informatik.fernuni-hagen.de/pi7/hartrumpf

Browse pgsql-general by date

  From Date Subject
Next Message Postgres DBA 1998-11-13 08:04:31 Re: [GENERAL] alter table ?
Previous Message The Hermit Hacker 1998-11-13 03:49:21 Re: [SQL] Can't starting postmaster with -B 512 Option