error when compiling a c function - Mailing list pgsql-general

From Ioana Danes
Subject error when compiling a c function
Date
Msg-id 1311784460.32387.YahooMailClassic@web120119.mail.ne1.yahoo.com
Whole thread Raw
Responses Re: error when compiling a c function  (Sebastian Jaenicke <sjaenick@CeBiTec.Uni-Bielefeld.DE>)
List pgsql-general
Hello,

I built a c function that exports data from various tables into a text file but when I compile the function I get this
error:

In file included from /usr/include/pgsql/server/postgres.h:48,
                 from myfile.c:1:
/usr/include/pgsql/server/utils/elog.h:69:28: error: utils/errcodes.h: No such file or directory

If I remove the utils/ folder in front of the errcodes.h file in elog.h then it works.

The only think I don't like (but I can live with...) is that every time I install a new version of postgres I have to
edit/usr/include/pgsql/server/utils/elog.h file and change the line: 
#include "utils/errcodes.h"
into
#include "errcodes.h"

Is there possible to get this fixed in the future release? I am using Suse compiled versions of Postgres.

Here is the "very" simplified version of my function:

#include "/usr/include/pgsql/server/postgres.h"
#include "/usr/include/pgsql/server/fmgr.h"

#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif


PG_FUNCTION_INFO_V1(initializefile);

Datum
initializefile(PG_FUNCTION_ARGS)
{
    PG_RETURN_INT32(1);
}


Thank you,
Ioana

pgsql-general by date:

Previous
From: "Karl Nack"
Date:
Subject: Re: Implementing "thick"/"fat" databases
Next
From: "Little, Douglas"
Date:
Subject: problems viewing information_schema.schemata