error when compiling a c function

From: Ioana Danes <ioanasoftware(at)yahoo(dot)ca>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: error when compiling a c function
Date: 2011-07-27 16:34:20
Message-ID: 1311784460.32387.YahooMailClassic@web120119.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Little, Douglas 2011-07-27 16:52:37 problems viewing information_schema.schemata
Previous Message Karl Nack 2011-07-27 16:18:14 Re: Implementing "thick"/"fat" databases