Introduction to Postgres hacking
Tomas Vondra, Nazir Bilal Yavuz
This workshop is an introduction into hacking on Postgres code, to help people with their first steps. It is intended for those who are interested either in contributing to Postgres directly, or plan to work on some extensions, Postgres forks etc. If you don’t plan to work on Postgres internals and write C code, this workshop may not be a good fit for you.
The planned agenda is roughly this:
- Brief introduction into the development process and how it’s organized (mailing lists, commit fests, patch submissions, buildfarm, tools used to organize all this). We might also discuss how this might evolve in the future.
- Walk through the source code, to explain how it’s organized, what are the basic modules, where to look for stuff, what tools are available, etc.
- Basic work with the code (cloning, using configure, running various types of tests).
- Advanced stuff (using github CI, …)
- Postgres-specific infrastructure and coding idioms (Datum, SQL vs. C functions, memory contexts and palloc, error logging, …).
We plan to do small exercises to get some practical experience with these topics, so bring your Linux laptop with a recent distribution (Fedora, Ubuntu, Debian, …). You won’t need anything very special, just console, git, gcc, and your favorite editor to write C code (we’ll setup the environment in the first section).
We expect basic knowledge of C, but we don’t expect you to know the strange/unique C stuff in Postgres. That’s what the workshop is meant to address. Prior experience with autotools is an advantage, not a requirement. After the workshop you should be familiar with how the Postgres project is organized, and with the fundamental tools and infrastructure used by Postgres. You may not be able to understand every patch right away, but you should have the foundations to quickly learn.