Fwd: lots of errors from fmgr.h when I try to write a C UDF

From: Anh Pham <atpham(dot)wpi(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Fwd: lots of errors from fmgr.h when I try to write a C UDF
Date: 2014-02-01 02:40:52
Message-ID: CAL7AQBYzB62_+J2htTrLv9kr2khAXAGwyN9QhVbWarjAvybaYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

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 */*
...

*Any suggestion where I did it wrong?*
Thank you :)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Lawrence Barwick 2014-02-01 03:53:54 Re: Fwd: lots of errors from fmgr.h when I try to write a C UDF
Previous Message Anh Pham 2014-02-01 02:31:00 lots of errors from fmgr.h when I try to write a C UDF

Browse pgsql-novice by date

  From Date Subject
Next Message Ian Lawrence Barwick 2014-02-01 03:53:54 Re: Fwd: lots of errors from fmgr.h when I try to write a C UDF
Previous Message Anh Pham 2014-02-01 02:31:00 lots of errors from fmgr.h when I try to write a C UDF