Re: Fwd: lots of errors from fmgr.h when I try to write a C UDF - Mailing list pgsql-general

From Ian Lawrence Barwick
Subject Re: Fwd: lots of errors from fmgr.h when I try to write a C UDF
Date
Msg-id CAB8KJ=j1_BUS_PycfA04mOh+OSR0GcUy6LWZp2512Rmw5e0Pzg@mail.gmail.com
Whole thread Raw
In response to Fwd: lots of errors from fmgr.h when I try to write a C UDF  (Anh Pham <atpham.wpi@gmail.com>)
Responses Re: Fwd: lots of errors from fmgr.h when I try to write a C UDF  (Anh Pham <atpham.wpi@gmail.com>)
List pgsql-general
2014-02-01 Anh Pham <atpham.wpi@gmail.com>:
> Hi,
> I had Postgres 9.3 setup and run successfully in Eclipse (MacOSX)
> I am trying to write a C user-defined function:
>
> #include <fmgr.h>
> ...
> #ifdef PG_MODULE_MAGIC
> PG_MODULE_MAGIC;
> #endif
> ...
>
> However, when I tried to compile the code:
> gcc -fpic -c ...
> It gave me a lot of errors and warnings from fmgr.h:
>
> ...
> /Users/atpham/workspacecdt/pgsql/src/include/fmgr.h:59:2: error: unknown
> type name 'MemoryContext'
>         MemoryContext fn_mcxt;          /* memory context to store fn_extra
> in */
>         ^
> /Users/atpham/workspacecdt/pgsql/src/include/fmgr.h:71:2: error: unknown
> type name 'Oid'
>         Oid                     fncollation;    /* collation for function to
> use */
>         ^
> /Users/atpham/workspacecdt/pgsql/src/include/fmgr.h:72:2: error: unknown
> type name 'bool'
>         bool            isnull;                 /* function must set true if
> result is NULL */
> …

You'll need to include the appropriate header files. Certainly "postgres.h".

Regards

Ian Barwick


pgsql-general by date:

Previous
From: Anh Pham
Date:
Subject: Fwd: lots of errors from fmgr.h when I try to write a C UDF
Next
From: Anh Pham
Date:
Subject: Re: Fwd: lots of errors from fmgr.h when I try to write a C UDF