Re: postgres functions and C++ - Mailing list pgsql-hackers

From Tom Lane
Subject Re: postgres functions and C++
Date
Msg-id 3332.970673388@sss.pgh.pa.us
Whole thread Raw
In response to postgres functions and C++  ("Vladimir V. Zolotych" <gsmith@eurocom.od.ua>)
List pgsql-hackers
"Vladimir V. Zolotych" <gsmith@eurocom.od.ua> writes:
>   my=> select days_in_month(3, 3, 3);
>   ERROR: Can't find function days_in_month in file /tmp/days.so

Try using 'nm' to see what symbol name is actually being exported
from the .so file.  I suspect that despite your use of extern "C",
your C++ compiler is being uncooperative and is naming the function
in some strange fashion at the link level.

There is an option in CREATE FUNCTION to specify the link symbol
name separately from the SQL name of the function, so if you can't
get your compiler to play nice you could still get it to work by
quoting whatever nm tells you...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Ashley Cambrell
Date:
Subject: Re: Version data type. - DONE
Next
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: WaitOnLock