473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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???
Jul 26 '13 #1
2 2057
rski
700 Expert 512MB
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
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

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

Similar topics

1
by: Joel Thornton | last post by:
Is it possible to call a user-defined function without prefixing it with 'dbo.' within a SELECT clause somehow? Just curious; it's not a big issue but just a stylistic one for me. Thanks! ...
2
by: Steve D | last post by:
I've looked all over but can't find a solid answer. I've got a function that runs from a View and when the function runs the first time it is calculating a Temperature for a group of Formulas. ...
3
by: Gary Besta | last post by:
I am trying to add a simple case statement to a stored procedure or user defined function. However when I try and save the function/procedure I get 2 syntax errors. Running the query in query...
2
by: Highlander416 | last post by:
This is driving me crazy. I need to create a UDF that would return a TRUE/FALSE (bit) value based on a comparison it does. CREATE FUNCTION dbo.SelectedByApplication ( @ApplicationID int,...
13
by: Maroon | last post by:
Hi, I want to write a standard java user defined function, like this example:- select db_fun("roll"), roll from student; **db_fun() will work for all tables of the all databse here db_fun is...
1
by: Mphoza | last post by:
Hi! Programmers,,,,,, Scenario I have a DataGrid with the delete button, If the user delete the row I'd like to show a confirmation dialog box with two buttons(Yes,No). If the user click yes...
3
by: chreo | last post by:
I have user-defined function in MSSQL which returns Table (with 10 columns) (sorry for Polish names) CREATE FUNCTION PACZKI_Z_AKCJI (@AKCJA_ID int) RETURNS TABLE RETURN SELECT TOP 100...
0
by: cognoid | last post by:
HI, I am completely new to DB2 and I am trying to get this user defined function to work. It doesn't seem to like the way I am using my input variables in the body of the function. I get the...
1
by: jeff_d_harper | last post by:
I've run into a problem with text encoding in the Sqlite3 module. I think it may be a bug. By default sqlite3 converts strings in the database from UTF-8 to unicode. This conversion can be...
1
by: qwedster | last post by:
Hola! In the following code snippet, I am creating User Defined Function (T-SQL) programmatically into database from C# Code: BTW, this code originally I wrote for creating StoredProcedure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.