Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 8C92298F705 for ; Tue, 5 Jun 2012 13:12:50 -0300 (ADT) Received: from nm2-vm0.bullet.mail.ukl.yahoo.com ([217.146.183.226]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SbwNE-0006Or-42 for pgsql-performance@postgresql.org; Tue, 05 Jun 2012 16:12:49 +0000 Received: from [217.146.183.213] by nm2.bullet.mail.ukl.yahoo.com with NNFMP; 05 Jun 2012 16:12:35 -0000 Received: from [217.146.183.61] by tm6.bullet.mail.ukl.yahoo.com with NNFMP; 05 Jun 2012 16:12:35 -0000 Received: from [127.0.0.1] by omp1030.mail.ukl.yahoo.com with NNFMP; 05 Jun 2012 16:12:35 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 78840.39380.bm@omp1030.mail.ukl.yahoo.com Received: (qmail 37425 invoked by uid 60001); 5 Jun 2012 16:12:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s1024; t=1338912754; bh=yiatx97phi8/i/8cjnQKPQnFOqiCeaBLn5kqN+8Q/2E=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=JcN3ZPuWGra0wjeuI+KblyZgibREC8sCK0om+AC07aq4CCrLESn6UBDKSJxAP/UuNVxwwGeryFxcR4q9hqFXR79cQ9Agnp5Y0HKx0hjhULaOcxKDHa+2KmLtvRM9YTMPgrR2hUYppkfW1ygQBVl2Iv2mMjbsEjHmViYaFp0zlfA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.es; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=3/OcZyaO3Wce/GlaxK7mym/w7/xPOwhweY/SrV08gyB8NGcS8Qxs9fDkl9KTFxfhSN61EdGkIpk/hRUiNS0N7sxu+OXNBfYCmZM2x0Gmwc26GWvZCIM2W/BIpUuUB6vFcNZEh/GwomgRAlN8yJqzJcM+o/WUJ4Qi1odF6gz9Ni0=; X-YMail-OSG: PV7eKY8VM1mUCPCLS9ZJQ7uFKsYPHokzBX9.F5awwvHpN_u oljcne6Tozk3MPgOIDf41YltaDxGgaIbGXA_Jfe1IoGjtE6pzuaCF9OHzEig TO.ARp8yVXcgbEhN844yi.GAsQVQqhkGb0Wv5mQXUc_LsyWTe5fre3u4uNjA hyS2.alF8Hzj2ROdGDX63_Bc7DZvjieeOtduebkLW4NfM0K6IYn7B.9yE9Pk ShyACQBkPtxeEAvmTJTtgpY4hVizMtQgSnsMJkQD3K6UBqXho3a2ix1xzmSD HeOCyehOTkBMIgGB7Jos6hnRWC0fZ6m2ZVo2XnuuhIIILpfNaYV40i5w3GI8 fUZa_a.HsVekTB5SeXpkXgRBGqo2Srh7AIQnJ_gsdivTNwo9UVGr900m08St xY8NgeSpfMt.u7FwtpnAQ5ZLSwkG57LZCTGw- Received: from [190.85.40.123] by web171003.mail.ukl.yahoo.com via HTTP; Tue, 05 Jun 2012 17:12:34 BST X-Mailer: YahooMailWebService/0.8.118.349524 Message-ID: <1338912754.27056.YahooMailNeo@web171003.mail.ukl.yahoo.com> Date: Tue, 5 Jun 2012 17:12:34 +0100 (BST) From: Alejandro Carrillo Reply-To: Alejandro Carrillo Subject: Missing block Magic To: "pgsql-performance@postgresql.org" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="165014346-1080788264-1338912754=:27056" X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/24 X-Sequence-Number: 47050 --165014346-1080788264-1338912754=:27056 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0A=0AI want to make a function in C for postgresql, this is the code:= =0A=0A#define _USE_32BIT_TIME_T=0A#define BUILDING_DLL 1 =0A=0A#include "po= stgres.h"=0A#include "fmgr.h"=0A#include "executor\spi.h" /* SPI - Server P= rogramming Interface */=0A=0A#if defined(_MSC_VER) || defined(__MINGW32__)= =0A#define PG_GETINF_EXPORT __declspec (dllexport)=0A#else=0A#define PG_GET= INF_EXPORT=0A#endif=0A=0APG_MODULE_MAGIC;=0A=0APG_GETINF_EXPORT PG_FUNCTION= _INFO_V1(suma);=0A=0ADatum suma(PG_FUNCTION_ARGS)=0A{=0Aint32 arg =3D PG_GE= TARG_INT32(0);=0A=A0=A0 =0APG_RETURN_INT32(arg + 1);=0A};=0A=0A=0AThis comp= ile sucessfull, but when I try to use:=0A=0ACREATE OR REPLACE FUNCTION add_= one(integer)=0ARETURNS integer AS=0A'C:\Documents and Settings\Administrado= r\Escritorio\test\test.dll', 'pg_finfo_suma'=0ALANGUAGE 'c' VOLATILE STRICT= =0ACOST 1;=0A=0AI get it:=0A=0AERROR:=A0 biblioteca =ABC:\Documents and Set= tings\Administrador\Escritorio\test\test.dll=BB incompatible: no se encuent= ra el bloque m=E1gico=0AHINT:=A0 Se requiere que las bibliotecas de extensi= =F3n usen la macro PG_MODULE_MAGIC.=0A=0APlease help me! I don't know to do= .=0A=0AThanks=0A --165014346-1080788264-1338912754=:27056 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
I want to make a function in C for postgresql, this is the cod= e:

#define _USE_32BIT_TIME_T
#define BUILDING_D= LL 1

#include "postgres.h"
#include "fmgr.h"
#include "execut= or\spi.h" /* SPI - Server Programming Interface */

#if defined(_MSC_= VER) || defined(__MINGW32__)
#define PG_GETINF_EXPORT __declspec (dllexp= ort)
#else
#define PG_GETINF_EXPORT
#endif

PG_MODULE_MAGIC;=

PG_GETINF_EXPORT PG_FUNCTION_INFO_V1(suma);

Datum suma(PG_FU= NCTION_ARGS)
{
int32 arg =3D PG_GETARG_INT32(0);
  
= PG_RETURN_INT32(arg + 1);
};

This compile s= ucessfull, but when I try to use:

CREATE OR REPLAC= E FUNCTION add_one(integer)
RETURNS integer AS
'C:\Documents and Settings\Administrador\Escritorio\test\test.dll', 'pg_finfo_suma'
LANGU= AGE 'c' VOLATILE STRICT
COST 1;

I get it:
=

ERROR:  biblioteca =ABC:\Documents and Settings\Ad= ministrador\Escritorio\test\test.dll=BB incompatible: no se encuentra el bl= oque m=E1gico
HINT:  Se requiere que las bibliotecas de extensi=F3n= usen la macro PG_MODULE_MAGIC.

Please help me! I = don't know to do.

Thanks
--165014346-1080788264-1338912754=:27056--