This workshop takes you on a journey to the internals of the PostgreSQL server. It is a hands-on-experience, where we will implement a running extension to the SQL of PostgreSQL in C. This involves changes to various phases of the system, starting from the parser and ending with the implementation of an algorithm within the executor. This workshop could be a good starting point, if you plan to implement your own patches. Happy hacking!
GitHub tutorial: http://bit.ly/1OyU0tD