Received: from hera.inf.ucv.cl (root@hera.inf.ucv.cl [158.251.10.6]) by hub.org (8.9.3/8.9.3) with SMTP id VAA63787; Fri, 7 May 1999 21:57:35 -0400 (EDT) (envelope-from cperalta@hera.inf.ucv.cl) Received: from olimpo20.inf.ucv.cl by hera.inf.ucv.cl (AIX 3.2/UCB 5.64/4.03) id AA05053; Fri, 7 May 1999 21:54:39 -0400 Message-Id: <3732FF2A.94199716@hera.inf.ucv.cl> Date: Fri, 07 May 1999 09:56:44 -0500 From: Carlos Peralta Ramirez X-Mailer: Mozilla 4.51 [en] (Win95; I) X-Accept-Language: en Mime-Version: 1.0 To: pgsql-novice , pgsql-hackers , pgsql-sql , pgsql-general Subject: Functions for arrays !!!! X-Priority: 1 (Highest) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi, I´m trying of to make a function that receive two arguments : - An array of int4 - A int4 The target of this function is to evaluate if the numeric argument is or not into of the array !!!!! /* If anybody know of some predefined function that has the same target, tell me !!!*/ The code is following (tester.c)-> #include #include bool tester(int4 o[],int4 a){ int i; for(i=0;o[i]!=0;i++) if (o[i]==a) return('t'); return('f'); } then I compile the code gcc -c tester.c /*Thanks to */ gcc -shared -o tester.so tester.o /*Michael J. Davis*/ , and get tester.so I create the function in PostgreSQL -> dbtest=>create function tester(_int4,int4) returns bool as '$path/tester.so' language 'c'; CREATE But when try to use it, -> dbtest=>select tester('{1,2,3,4}',3); ERROR: stat failed on file tester.so /*Here I hope a 't' */ I don´t know what´s happens !!!!! Carlos Peralta Ramírez !!!!!