postgres/postgres
By the numbers
A quantitative snapshot of the PostgreSQL repository. Data collected on 2026-04-30 from the master branch at commit 3dd42ee97b8.
Size
PostgreSQL is a mature, large C project. Core counts:
| Metric | Value |
|---|---|
| Total commits in the repo | ~64,175 |
| Earliest commit | 1996-07-09 (Postgres95 1.01) |
Source .c files (entire tree) |
1,543 |
Source .h files |
1,019 |
.sgml doc files |
430 |
Perl scripts (.pl) |
357 |
.sql test/extension scripts |
855 |
Bison grammars (.y) |
11 |
C source lines (in src/) |
~1,479,000 |
C header lines (in src/) |
~200,000 |
xychart-beta horizontal
title "Lines of code by language (in src/)"
x-axis ["C source", "C headers", "SGML docs", "SQL", "Perl"]
y-axis "Lines (thousands)" 0 --> 1500
bar [1479, 200, 250, 200, 80](SGML, SQL, and Perl line counts are approximate, derived from line counts of representative subsets.)
Activity
Commits per year, recent slice:
| Period | Commits |
|---|---|
| Apr 2025 → Apr 2026 | ~3,187 |
| Apr 2024 → Apr 2025 | ~2,809 |
PostgreSQL has been remarkably consistent: roughly 2,500–3,500 commits per year for many years, with bursts around feature freezes. Releases happen annually in autumn (PostgreSQL 17 in late 2024, PostgreSQL 18 in late 2025).
The most actively changed top-level areas (rough churn over the last year) are:
| Area | Notes |
|---|---|
src/backend/access |
Heap, btree, GIN, GiST, BRIN — new tuple-level features and bug fixes. |
src/backend/replication |
Logical replication continues to be a hotspot of ongoing work. |
src/backend/optimizer |
Plan-shape and costing improvements. |
src/backend/storage/aio |
Async I/O subsystem (relatively new, see below). |
doc/src/sgml |
Documentation evolves alongside features. |
Bot-attributed commits
Commits whose message contains Co-authored-by: (any source): ~333 out of ~64,175 (≈0.5%).
PostgreSQL is overwhelmingly authored by humans on pgsql-hackers. The mailing-list-driven workflow does not naturally produce GitHub bot co-authorship, and the project does not currently use Dependabot, GitHub Actions auto-PRs, or AI commit assistants. The Co-authored-by: lines that exist are typically human reviewers credited by the committer, not bots — the git filter for [bot] accounts returns essentially zero matches against this repo. Inline AI tools (Copilot, etc.) leave no trace, so this number is a lower bound, but the order of magnitude matches the prevailing engineering culture.
Complexity
Hot files by size in the backend (largest source files, top of the list):
| File | Approx. lines |
|---|---|
src/backend/postmaster/postmaster.c |
~4,000 |
src/backend/access/transam/xlog.c |
~9,500 |
src/backend/utils/misc/guc_tables.c |
~5,000+ (auto-extending; one entry per GUC) |
src/backend/parser/gram.y |
~18,000 (largest single file, generated grammar) |
src/backend/optimizer/path/costsize.c |
~6,000 |
src/backend/utils/adt/ruleutils.c |
~13,000 |
src/backend/utils/adt/jsonpath_exec.c |
~3,500 |
The grammar (gram.y) and the rule deparser (ruleutils.c) are perennial outliers because both must enumerate every SQL construct PostgreSQL supports. They are working as designed but are good places to expect slow recompiles.
The optimizer's join planning (src/backend/optimizer/path/joinpath.c, costsize.c) and the executor's expression interpreter (src/backend/executor/execExprInterp.c) are the densest in terms of computational logic per line.
Dependency profile
PostgreSQL has no language-level package manifest — dependencies are detected at configure time. The mandatory or near-mandatory libraries are:
- libc (POSIX or Win32)
- ICU (mandatory in recent versions for collation)
- OpenSSL (effectively required for production)
- zlib
Optional but common:
- LLVM (JIT)
- libxml2, libxslt
- Readline / libedit
- Perl, Python, Tcl (for the PL languages)
- liburing (Linux AIO)
See reference/dependencies.md for the full list and where they are detected.
Test coverage breadth
PostgreSQL ships its own multi-pronged test infrastructure:
- Core regression tests —
src/test/regress/: ~250 SQL test files covering language features, functions, types, and DDL. - Isolation tests —
src/test/isolation/: ~100 specs that check concurrent-execution semantics. - TAP tests —
src/test/recovery/,src/test/subscription/,src/test/authentication/, etc., plus per-binary suites undersrc/bin/<tool>/t/. Several hundred Perl scripts. pg_regress— the harness that drives core regression. Source:src/test/regress/pg_regress.c.
Together they account for the bulk of the project's testing bandwidth. See Testing.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.