From: | Pei He <hepeimail(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Problem of Magic Block in Postgres 8.2 |
Date: | 2010-04-02 02:02:50 |
Message-ID: | k2t7b45659f1004011902p901df11fg2ce3bfea5556f79a@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
I have some old code for extension functions in Postgres 8.0. And, I
am trying to make it work with Postgres 8.2.
One problem is about the Magic Block.
The extension functions was developed by C++ mixed with C.
The code is like:
extern "C" Datum spgistinsert(PG_FUNCTION_ARGS)
{
...
}
I have added enough PG_MODULE_MAGIC; to the source code. (Also,
include 'fmgr.h' and 'postgres.h')
But, when I create the function inside Postgres, it still complains as
following:
ERROR: incompatible library
"/home/hepei/bin/Chameleon/lib/libspgist_trie.so": missing magic block
HINT: Extension libraries are required to use the PG_MODULE_MAGIC macro.
STATEMENT: /* Load the trie extension */
/*------------------------ */
load '/home/hepei/bin/Chameleon/lib/libspgist_trie.so';
ERROR: incompatible library
"/home/hepei/bin/Chameleon/lib/libspgist_trie.so": missing magic block
HINT: Extension libraries are required to use the PG_MODULE_MAGIC macro.
I am capable to define a simple function in a single file by C, and
make it work with postgres 8.2. However, my old code is more complex,
which involves more source code, library, and it is also using both
C++ and C. So, I am not sure where the problem comes from, and how to
solve it.
Thanks
Look forward your reply
--
Pei
From | Date | Subject | |
---|---|---|---|
Next Message | Fujii Masao | 2010-04-02 02:53:37 | Re: pending patch: Re: Streaming replication and pg_xlogfile_name() |
Previous Message | Simon Riggs | 2010-04-01 23:06:13 | Re: master in standby mode croaks |