Tenes instalado los fuentes de la version 9? En su momento yo logre compilar tanto con Visual C y MingW
Te paso el link con las instrucciones, espero que te sirva: http://www.arpug.com.ar/trac/wiki/CompilandoPostgreSQLEnWindows Sds Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com 2011/10/27 Edwin Quijada <listas_quij...@hotmail.com>: > Hola ! Estoy tratando de compilar unas funciones que he hecho en C para > Postgres en Windows la compilacion me arrojo warnings pero compilo > D:\exte_c>compila2 > D:\exte_c>D:\mingw\bin\gcc -g -O2 -Wall -Wmissing-prototypes -Wpointer-arith > -Wdeclaration-after-statement > -Wendif-labels -fno-strict-aliasing -fwrapv -I "C:/ariela/db/include/" > -I "C:/ariela/db/include/server" -I > "C:/ariela/db/include/server/port/win32" > -DEXEC_BACKEND "-I C:/ariela/db/include/server/port/win32" -c pg2.c -o pg2.o > In file included from C:/ariela/db/include/server/postgres.h:47,from > pg2.c:3: > C:/ariela/db/include/server/c.h:284:2: #error must have a working 64-bit > integer datatype > In file included from pg2.c:3: > C:/ariela/db/include/server/postgres.h:550: error: syntax error before "X" > In file included from pg2.c:5: > libstd.h:116: warning: no previous prototype for 'getmacwindows2num' > pg2.c:40: warning: no previous prototype for 'pg_serverid' > pg2.c: In function `pg_serverid': > pg2.c:44: warning: ISO C90 forbids mixed declarations and code > pg2.c: At top level: > pg2.c:52: warning: no previous prototype for 'one' > D:\exte_c>D:\mingw\bin\gcc -shared -o pg_server_function.dll pg2.o -L > "C:\ariela\db\lib" -lpostgres > Al terminar me genero un archivo llamado pg_server_function.dll que es donde > estan las funciones en C ya compiladas > Mi problema es que al momento de agregar estas funciones a la BD usando > CREATE FUNCTION pg_serverid(integer) RETURNS double precision > AS 'D:\\exte_c\\pg_server_function.dll', 'pg_serverid' > LANGUAGE C STRICT; > Consigo estos errores:::::::: > WARNING: nonstandard use of \\ in a string literal > LINE 2: AS 'D:\\exte_c\\pg_server_function.dll', 'pg_serverid' > ^ > HINT: Use the escape string syntax for backslashes, e.g., E'\\'. > ERROR: incompatible library "D:\exte_c\pg_server_function.dll": version > mismatch > DETAIL: Server is version 9.0, library is version 8.3. > ********** Error ********** > ERROR: incompatible library "D:\exte_c\pg_server_function.dll": version > mismatch > SQL state: XX000 > Detail: Server is version 9.0, library is version 8.3. > Lo extraño es que si compile contra la version 9 no la 8.3, bueno cuando > hice la función la hice con 8.3 pero esa versión incluso la desinstale de la > maquina para recompilar con la 9 > Lo compilo de esta forma > D:\mingw\bin\gcc -g -O2 -Wall -Wmissing-prototypes > -Wpointer-arith > -Wdeclaration-after-statement > -Wendif-labels -fno-strict-aliasing > -fwrapv -I "C:/ariela/db/include/" > -I "C:/ariela/db/include/server" > -I "C:/ariela/db/include/server/port/win32" > -DEXEC_BACKEND "-I C:/ariela/db/include/server/port/win32" -c pg2.c -o pg2.o > D:\mingw\bin\gcc -shared -o pg_server_function.dll pg2.o -L > "C:\ariela\db\lib" -lpostgres > No se algún parámetro de esto le asegura que es la versión 8.3 pero supongo > que no porque son solo parámetros del compilador. Uso MinGW para compilar. > La instalacion de Postgres la hice desde el instalador de EnterpriseDB , > sera que tienen la version 8.3 ? No creo...no? > > *-------------------------------------------------------* > *-Edwin Quijada > *-Developer DataBase > *-JQ Microsistemas > *-Soporte PostgreSQL > *-www.jqmicrosistemas.com > *-809-849-8087 > *-------------------------------------------------------* > > - Enviado a la lista de correo pgsql-es-ayuda (pgsql-es-ayuda@postgresql.org) Para cambiar tu suscripción: http://www.postgresql.org/mailpref/pgsql-es-ayuda