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 an older version of PostgreSQL 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, the sole purpose of which is to demonstrate how a PostgreSQL's PL/* language should be written (see http://pgfoundry.org/projects/pllolcode/). You may also 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 or in the official PostgreSQL documentation, then remember that lots of PostgreSQL's backend developer documentation—often including answers to the questions How? and Why?—is in the source files. A lot of that can also be relevant to C extensions.

So remember—Use The Source, Luke!

In the next chapter we will discuss scaling the database using PL/Proxy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.131.142.80