With PostgreSQL 9.4 just around the corner and 8.4 just retired I thought it is time to review those years of development to see how the size of the PostgreSQL code base has evolved over time. In the past couple of years (I even already got to say “decades”) a lot of development has happened and all those changes had a significant impact on the sheer volume of the code.

Out of plain curiosity I decided to start a little analysis regarding the code size of the PostgreSQL project over time.

To start the analysis I decided to count the lines of plain C code, all header files as well as grammar files (.y). Here is the shell command used on all versions:

find . -type f -name "*.[chy]" | xargs -I {} cat {} | wc -l

The results are pretty interesting:
9.3.5: 1190501
9.2.9: 1146762
9.1.14: 1091400
9.0.18: 1018774
8.4.22: 954521

0a

The interesting thing here to see is that the size of the code has grown fairly consistently over time. From one major release to the next we see a constant increase in code source, which is more or less stable over the years.

Historically …

Just out of curiosity: On 29th of January 1997 PostgreSQL 6.0 was released. A long long time ago. Guess what the size of the code was back then.

The answer is? 185437 lines

0b

PostgreSQL has come a long way since then.