Re: [GENERAL] Missing magic block

2007-05-12 Thread Tom Lane
Mario Munda <[EMAIL PROTECTED]> writes: > I've changed: > #ifdef PG_MODULE_MAGIC > PG_MODULE_MAGIC; > #endif > to: > #define PG_MODULE_MAGIC ; Uh, that turns it into a complete no-op. It should just be PG_MODULE_MAGIC; If you tried that and it didn't compile, that's proof that you're using pr

Re: [GENERAL] Missing magic block

2007-05-12 Thread Mario Munda
I've changed: #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif to: #define PG_MODULE_MAGIC ; and the .so does compile, but the database is still reporting the same error when i try to CREATE FUNCTION: ERROR: incompatible library "/home/mario/tests/psql_c_func/ test_func.so": missing magic block

Re: [GENERAL] Missing magic block

2007-05-10 Thread Tom Lane
Mario Munda <[EMAIL PROTECTED]> writes: > I had to comment some includes out, or else i get some errors. Perhaps you are compiling against an old or incomplete set of Postgres header files? > #ifdef PG_MODULE_MAGIC > PG_MODULE_MAGIC; > #endif The problem with that coding is that it will silently

Re: [GENERAL] Missing magic block

2007-05-10 Thread Mario Munda
"Brad Buran" je napisal: > Hi Martijn, > > Thank you very much for the suggestion: > > > > CREATE FUNCTION add_one(IN int) > > > RETURNS int > > > AS 'add_one' > > > LANGUAGE C; > > I corrected this to say: > > AS 'Project1', 'add_one' > > And restarted psql (rebooted for that matter a

Re: [GENERAL] Missing magic block

2007-04-23 Thread Brad Buran
Hi Martijn, Thank you very much for the suggestion: > > CREATE FUNCTION add_one(IN int) > > RETURNS int > > AS 'add_one' > > LANGUAGE C; I corrected this to say: AS 'Project1', 'add_one' And restarted psql (rebooted for that matter as well) and am still getting the same err

Re: [GENERAL] Missing magic block

2007-04-22 Thread Martijn van Oosterhout
On Sun, Apr 22, 2007 at 06:52:33PM -0400, Brad Buran wrote: > I'm trying to learn how to write custom extensions to postgres so wrote a > basic C function to see how it works. However, I keep getting the following > error "Missing magic block" when I try to add the function to the database. > Acco