From: | "Brad Buran" <bburan(at)MIT(dot)EDU> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Missing magic block |
Date: | 2007-04-22 22:52:33 |
Message-ID: | 004601c78530$eab8c310$0c05fa12@issphoenix |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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.
According to the documentation in the manual, all I need to do is add the
following:
#include "server/fmgr.h"
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
To my C file and it will work. However, I guess it is not working? Below
is the source code:
#include "server/postgres.h"
#include <string.h>
#include "server/fmgr.h"
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
int
add_one(int arg)
{
return arg + 1;
}
And the sql statement I am using is:
CREATE FUNCTION add_one(IN int)
RETURNS int
AS 'add_one'
LANGUAGE C;
Any feedback as to how to correct it is appreciated!
Thanks,
Brad
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2007-04-23 01:14:12 | Re: contributing patches |
Previous Message | Raymond O'Donnell | 2007-04-22 22:50:57 | Re: ERROR: Failed to build any 5-way joins |