Received: from hermes.gatewaynet.com (hermes.gatewaynet.com [217.19.69.34]) by postgresql.org (Postfix) with ESMTP id B0A8B474E4E; Tue, 26 Mar 2002 06:59:12 -0500 (EST) Received: œby rnd@gatewaynet.com (8.12.1/8.12.1) with ESMTP id g2QBxDO2001958; Tue, 26 Mar 2002 13:59:13 +0200 (EET) Received: from pc216 ([10.9.200.216]) by hermes.internal.net (Lotus Domino Release 5.0.9a) with SMTP id 2002032613591322:12959 ; Tue, 26 Mar 2002 13:59:13 +0200 From: Achilleus Mantzios To: pgsql-sql@postgresql.org Subject: C Function with Arrays Question Date: Tue, 26 Mar 2002 14:00:00 +0200 X-Mailer: KMail [version 1.2] MIME-Version: 1.0 Cc: pgsql-general@postgresql.org Message-Id: <02032614000004.09965@pc216> X-MIMETrack: Itemize by SMTP Server on hermes/hermes(Release 5.0.9a |January 7, 2002) at 03/26/2002 01:59:13 PM, Serialize by Router on hermes/hermes(Release 5.0.9a |January 7, 2002) at 03/26/2002 01:59:13 PM, Serialize complete at 03/26/2002 01:59:13 PM Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-7" X-Archive-Number: 200203/1228 X-Sequence-Number: 22588 Hi, Is there a way of accessing _float8 (float8[]) values inside of a server-side C function?? For instance imagine: # \d formulatest Table "formulatest" Column | Type | Modifiers ---------+--------------------+----------- formula | double precision[] | # insert into formulatest values('{2.3,3.3}'); # insert into formulatest values('{4.3,5.3}'); and then write a C function named formula float8 *formula(x,formarray) float8 *x; _float8 *formarray; /* This is serious part of the question!! */ { float8 *result = (float8 *) malloc(sizeof(float8)); /* what happened to palloc in pgsql 7.2??, * Also what happened to postgres.h?? */ *result = *formarray[0]; return result; /* This is pseudo code to demonstrate the question */ } Thanx. P.S. 7.2 runs quite stable on my Linux 2.4.7. JDBC built without a problem, and also supports Arrays (at least one dimension for sure). -- Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt tel: +30-10-8981112 fax: +30-10-8981877 email: it@dynacomtm.com rnd@gatewaynet.com