Re: [GENERAL] C-Functions using SPI - Missing Magic Block

2012-07-13 Thread eugeniotapias
HI, El viernes, 2 de julio de 2010 10:26:43 UTC-3, (desconocido) escribió: > Hello, > > I've got a problem with Functions in C using SPI. > > Using: PostgreSQL 8.3, Codeblocks, Windows Server 2003 R2 > > I compiled the file "pgExampleSPI.c" with the following code > without any error: > > /*

Re: [GENERAL] C-Functions using SPI - Missing Magic Block

2010-07-05 Thread Sam Mason
On Mon, Jul 05, 2010 at 10:20:30AM +0200, saitenhe...@web.de wrote: > Datum count_person(PG_FUNCTION_ARGS) { > SPI_connect(); > int ret = SPI_exec("SELECT count(*) FROM person", 0); > SPI_finish(); > PG_RETURN_INT32(ret); > } > > But I guess I still did something wrong, because no matter how many

Re: [GENERAL] C-Functions using SPI - Missing Magic Block

2010-07-05 Thread Saitenheini
Hi people, after a two days break: I could compile the following code with Visual C++ Express 2010 under Windows Server 2003 R2: /* Use 32-bit timer (provided header file uses 64-bit timer, not * compatible with Windows postgreSQL versions */ #define _USE_32BIT_TIME_T #define BUILDING_DLL 1 #in

Re: [GENERAL] C-Functions using SPI - Missing Magic Block

2010-07-03 Thread Martijn van Oosterhout
On Sat, Jul 03, 2010 at 09:35:56AM +0800, Craig Ringer wrote: > On 02/07/10 21:26, saitenhe...@web.de wrote: > > > #ifdef PG_MODULE_MAGIC > > PG_MODULE_MAGIC; > > #endif > > Why the conditional compilation of PG_MODULE_MAGIC? That's the recommendation, so the module compiles on all versions of P

Re: [GENERAL] C-Functions using SPI - Missing Magic Block

2010-07-02 Thread Craig Ringer
On 02/07/10 21:26, saitenhe...@web.de wrote: > #ifdef PG_MODULE_MAGIC > PG_MODULE_MAGIC; > #endif Why the conditional compilation of PG_MODULE_MAGIC? > ERROR: incompatible library "G:/PostgreSQL/8.3/lib/pgExampleSPI.dll": > missing magic block > TIP: Extension libraries are required to use the

Re: [GENERAL] C-functions using SPI Missing Magic Block Error

2010-07-02 Thread Saitenheini
I'll try b) and hope I can find a solution. Thanks for your support Joe. Kind Regards, Max. >On 07/02/2010 08:36 AM, saitenhe...@web.de wrote: >> Thanks, I've already tried that. I doesn't make any difference. Still the >> same error. >> >> in Visual C++ I can't even compile it, although I se

Re: [GENERAL] C-functions using SPI Missing Magic Block Error

2010-07-02 Thread Joe Conway
On 07/02/2010 08:36 AM, saitenhe...@web.de wrote: > Thanks, I've already tried that. I doesn't make any difference. Still the > same error. > > in Visual C++ I can't even compile it, although I set all links and > compiler directories like it was told in this post: > http://www.postgresql.org/

Re: [GENERAL] C-functions using SPI Missing Magic Block Error

2010-07-02 Thread Saitenheini
Thanks, I've already tried that. I doesn't make any difference. Still the same error. in Visual C++ I can't even compile it, although I set all links and compiler directories like it was told in this post: http://www.postgresql.org/docs/8.2/interactive/xfunc-c.html I don't have more ideas. Wh

Re: [GENERAL] C-functions using SPI Missing Magic Block Error

2010-07-02 Thread Joe Conway
On 07/02/2010 08:13 AM, saitenhe...@web.de wrote: > Thanks for reply Tom! > > I've tried several version: > > #define _USE_32BIT_TIME_T > > #include "postgres.h" > #include "fmgr.h" > #include "executor\spi.h" > > /* > #ifdef PG_MODULE_MAGIC > PG_MODULE_MAGIC; > #endif > */ > but still the sam

Re: [GENERAL] C-functions using SPI Missing Magic Block Error

2010-07-02 Thread Saitenheini
Thanks for reply Tom! I've tried several version: #define _USE_32BIT_TIME_T #include "postgres.h" #include "fmgr.h" #include "executor\spi.h" /* #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif */ extern Datum count_person (PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(count_person); __declspec(dllex

Re: [GENERAL] C-functions using SPI Missing Magic Block Error

2010-07-02 Thread Tom Lane
saitenhe...@web.de writes: > I compiled the file "pgExampleSPI.c" with the following code without any > error: > /* Use 32-bit timer (provided header file uses 64-bit timer, not > * compatible with Windows postgreSQL versions */ > #define _USE_32BIT_TIME_T > #include "postgres.h" > #include "exe

[GENERAL] C-functions using SPI Missing Magic Block Error

2010-07-02 Thread Saitenheini
Hello, I've got a problem with user defined functions in C using SPI. Using: PostgreSQL 8.3.7, Codeblocks (GNU GCC Compiler), Windows Server 2003 R2 I compiled the file "pgExampleSPI.c" with the following code without any error: /* Use 32-bit timer (provided header file uses 64-bit timer, not *

[GENERAL] C-Functions using SPI - Missing Magic Block

2010-07-02 Thread Saitenheini
Hello,I've got a problem with Functions in C using SPI.Using: PostgreSQL 8.3, Codeblocks, Windows Server 2003 R2I compiled the file "pgExampleSPI.c" with the following code without any error:/* Use 32-bit timer (provided header file uses 64-bit timer, not* compatible with Windows postgreSQL version