Missing magic block

Поиск
Список
Период
Сортировка
От Brad Buran
Тема Missing magic block
Дата
Msg-id 004601c78530$eab8c310$0c05fa12@issphoenix
обсуждение исходный текст
Ответы Re: Missing magic block
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: ptjm@interlog.com (Patrick TJ McPhee)
Дата:
Сообщение: Re: can't start tsearch2 in 8.2.4
Следующее
От: Tom Lane
Дата:
Сообщение: Re: can't start tsearch2 in 8.2.4