next up previous contents index
Next: Register the New Functions Up: Extending POSTGRESQL Using C Previous: Write the C Code

Compile the C Code

The next step is to compile the C file into an object file that contains CPU instructions. As part of this step, you must create a special object file that can be dynamically linked  into the POSTGRESQL server. Many operating systems require special flags to create an object file that can be dynamically linked. The best way to find the required flags is to go to pgsql/src/test/regress and type make clean and then make regress.so.24.1 This command will display the compile commands used to generate the dynamically linkable object file regress.so. The -I compile flags allow searching for include files. Other flags are used for generating dynamic object files; use them to compile your C code into a dynamically linkable object file. You may need to consult your operating system documentation for assistance in locating the proper flags.


Bruce Momjian
2001-05-09