cannot create a user defined function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mberrada
    New Member
    • Jul 2013
    • 2

    cannot create a user defined function

    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???
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    Is it written
    Code:
    Once we have written the I/O functions and compiled them into a shared library
    You have to compile code into shared library

    Comment

    • mberrada
      New Member
      • Jul 2013
      • 2

      #3
      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

      Comment

      Working...