By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

cannot create a user defined function

P: 2
Hi guys,
I am trying to follow this: http://www.postgresql.org/docs/9.2/static/xtypes.html
to learn how to create new functions and datatypes. But I keep getting error for the CREATE FUNCTION because of the "filename" portion. I get the error: could not access file . filename: no such file or directory.

I am not actually sure on what goes on the "filename". I tried the folder where they are defined: postgresql-9.2.3/src/backend/utils/adt' or the file name itself geo_ops.c (that's where my functions are defined).

It says that I have to have it compiled and loaded but I thought that this was automatically done since geo_ops is already part of the source code. Any help please???
Jul 26 '13 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 700
Is it written
Expand|Select|Wrap|Line Numbers
  1. Once we have written the I/O functions and compiled them into a shared library
  2.  
You have to compile code into shared library
Jul 26 '13 #2

P: 2
yes, you are right! But this is actually my problem. I am apperently not able to compile it into shared library
so when I go to the postgres folder, and try this command:
cc -fpic -c src/backend/utils/adt/geo_ops.c
I get this error:
fatal error: postgres.h: No such file or directory

I really don't understand why. I read many articles about how to compile into a shared lib and they all suggest the same thing...
(this is the article I am using http://www.postgresql.org/docs/7.1/static/xfunc-c.html and I am using a linux machine)
Thanks
Jul 26 '13 #3

Post your reply

Sign in to post your reply or Sign up for a free account.