postgres functions and C++

Поиск
Список
Период
Сортировка
От Vladimir V. Zolotych
Тема postgres functions and C++
Дата
Msg-id 8541.001004@eurocom.od.ua
обсуждение исходный текст
Ответы Re: postgres functions and C++  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello all,

Please help me with
create function days_in_month(int4, int4, int4) returns int4
as '/tmp/days.so' language 'c';

Can I write this function days_in_month in C++ ?
I've did the following:

extern "C" {
int days_in_month(int year, int mo, int day); 
} 

extern "C" { 
int days_in_month(int year, int mo, int day) { 
═══ return 13;
} 
} 

Compile with $ g++ -I/usr/local/qt/include -o days.so -shared days.cpp

then (as user postgres) my=> create function days_in_month(int4, int4, int4) returns int4 my=> as '/tmp/days.so'
language'c'; CREATE 
 
I've tried to use new function my=> select days_in_month(3, 3, 3); ERROR:═ Can't find function days_in_month in file
/tmp/days.somy=> 
 
What is wrong ?
I'm using postgres 6.4 under RedHat.
Any help will be appreciated.

-- 
Best regards,Vladimir                          mailto:gsmith@eurocom.od.ua




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Meskes
Дата:
Сообщение: Re: ecpg enhance patch
Следующее
От: Philip Warner
Дата:
Сообщение: Re: pg_dump and quoting