Re: [INTERFACES] Compiling a function

From: Craig Orsinger <orsingerc(at)epg-gw1(dot)lewis(dot)army(dot)mil>
To: "Gene Selkov, Jr(dot)" <selkovjr(at)mcs(dot)anl(dot)gov>
Cc: pgsql-interfaces(at)postgreSQL(dot)org, Matthew Hagerty <matthew(at)venux(dot)net>
Subject: Re: [INTERFACES] Compiling a function
Date: 1999-04-20 20:05:21
Message-ID: XFMail.990420130521.orsingerc@epg-gw1.lewis.army.mil
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

It also seems possible that you forgot to change the SQL
statement that you used to add the function(s) into the database.
Somewhere, you ran a SQL statement of the form:

create function bool2int(opaque) returns int4
as '/usr/local/pgsql/procs/bool2int.o'
language 'c';

So make sure you change that ".o" to ".so". BTW, this is
true on most Unix flavors, if not all. If you have to pass parameters
to the 'bool2int()' function, then describe them rather than using
the "opaque" description.

regards,

----------------------------------
Date: 20-Apr-99 Time: 13:00:02

Craig Orsinger (email: <orsingerc(at)epg(dot)lewis(dot)army(dot)mil>)
Logicon RDA
Bldg. 8B28 "Just another megalomaniac with ideas above his
6th & F Streets station. The Universe is full of them."
Ft. Lewis, WA 98433 - The Doctor
----------------------------------

On 20-Apr-99 Gene Selkov, Jr. wrote:
>> ERROR: Can't find function bool2int in file
>> /usr/local/pgsql/procs/bool2int.o
>>
>
> That's probably because you are still looking in the object file. If
> you did not tweak the filenames, the linker should create a shared
> object file with the .so suffix, and it's likely that it did. Use
> 'file' to find out, like this (real example):
>
> file /home/wit/pgsql/ExtendedTypes/seg/seg.o
> /home/wit/pgsql/ExtendedTypes/seg/seg.o: ELF 32-bit LSB relocatable, Intel
> 80386, version 1, not stripped
>
> file /home/wit/pgsql/ExtendedTypes/seg/seg.so
> /home/wit/pgsql/ExtendedTypes/seg/seg.so: ELF 32-bit LSB shared object, Intel
> 80386, version 1, not stripped
>
>> I have tried every linker flag possible, nothing helps. Seems funny that a
>> function cannot be located in a library file?!?!
>
> Object files and shared libraries have different symbol tables, let
> alone the code.
>
> I remember building things painlessly in FreeBSD, but that was a
> couple years back, so I am not sure now. In any event, I would start
> with tutorial examples because these are almost guaranteed to
> work. Also, here's a complete code for a user-defined function -- you
> will only need to adjust the paths in the Makefile and in the sql
> script:
>
> http://wit.mcs.anl.gov/~selkovjr/foldit.tgz
>
> --Gene
>

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message David Smith 1999-04-20 22:18:59 Macintosh ODBC port?
Previous Message Ken J. Wright 1999-04-20 19:13:39 Re: [INTERFACES] TUPLES <> HEAP