everyone. I try to make simple example of how to create stored procedures in PostgreSQL written in C language. When compiling "test.c" there's an error "Unknown type Datum". I use Version 1 Calling convention. PostgreSQL 9.1 is installed on my server under Ubuntu 11.10. Please help. By the way does anybody have step-by-step example of creating stored procedures in C language? Thanks
I wrote up a mind dump while I was doing this awhile back on FreeBSD. Here is the link in case it might help.
Compile C function to stored procedure brain dump
#include directives inside the PostgreSQL example (foo.c) from #include "" to #include<>To compile, add the include search path with the directive
-I (gcc -fpic -c foo.c -I/usr/include/postgresql/9.1/server/)
Continue as its said in the Postgres documentation
http://www.postgresql.org/docs/9.1/static/xfunc-c.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With