Summary
As C is the language that PostgreSQL itself is written in, it is very hard to draw a distinction on what is an extension function using a defined API and what is hacking PostgreSQL itself.
Some of the topics that we did not touch at all were:
Creating new installable types from scratch—see
contrib/hstore/
for a full implementation of a new type.Creating new index methods—download some older version of PosrgreSQL to see how full text indexing support was provided as an add-on.
Implementing a new PL/* language—search for
pl/lolcode
for a language whose sole purpose is to demonstrate how a PotgreSQLs PL/* language should be written (see http://pgfoundry.org/projects/pllolcode/). You also may want to check out the source code for PL/Proxy for a clean and well maintained PL language. (The usage of PL/Proxy is described in the next chapter.)
Hopefully this chapter gave you enough info to at least start writing PostgreSQL extension functions in C.
If you need more than what is available here...