July 2005
Intermediate to advanced
1032 pages
27h 10m
English
Now that you have created the input (external to internal) and output (internal to external) functions in C, you must compile them into a shared object module:
$ make -f makefile fcur.so
Next, create a symbolic link between fcur.so and PostgreSQL's preferred package directory so that PostgreSQL knows how to find out code:
$ ln -s `pwd`/fcur.so `pg_config --pkglibdir`
Now you can define the input and output functions in PostgreSQL:
movies=# CREATE OR REPLACE FUNCTION fcur_in( opaque ) movies-# RETURNS opaque movies-# AS 'fcur.so' LANGUAGE 'C' movies=# IMMUTABLE STRICT CREATE movies=# CREATE OR REPLACE FUNCTION fcur_out( opaque ) movies-# RETURNS opaque movies-# AS 'fcur.so' LANGUAGE 'C' ...
Read now
Unlock full access