Received: from Roland.eurocom.od.ua (Roland.EuroCom.Od.UA [212.15.128.1]) by hub.org (8.10.1/8.10.1) with ESMTP id e948QBG06853 for ; Wed, 4 Oct 2000 04:26:13 -0400 (EDT) Received: from O15.ti.com.od.ua (O15.ti.com.od.ua [212.15.128.233]) by Roland.eurocom.od.ua (8.10.0/8.10.0) with ESMTP id e948PPY06033 for ; Wed, 4 Oct 2000 11:25:37 +0300 Date: Wed, 4 Oct 2000 11:24:22 +0400 From: "Vladimir V. Zolotych" X-Mailer: The Bat! (v1.36) UNREG / CD5BF9353B3B7091 Reply-To: "Vladimir V. Zolotych" X-Priority: 3 (Normal) Message-ID: <0475.001004@eurocom.od.ua> To: pgsql-admin@postgresql.org Subject: postgres C++ functions Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit X-Archive-Number: 200010/22 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.so my=> What is wrong ? I'm using postgres 6.4 under RedHat. Any help will be appreciated. -- Best regards, Vladimir mailto:gsmith@eurocom.od.ua