postgres/postgres
Lore
PostgreSQL has been under continuous development since 1996. This page is a narrative tour of how the codebase evolved — eras, deprecated features, major rewrites, and longest-standing code.
Origins
The repository's first commit is dated 9 July 1996: d31084e9d11 — Postgres95 1.01 Distribution - Virgin Sources. That import is the seed of every line in the tree today. Postgres95 itself descended from the Berkeley Postgres research project (1986–1994, led by Michael Stonebraker), which in turn descended from Ingres.
Even today, every source file carries the dual notice:
Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
Portions Copyright (c) 1994, Regents of the University of CaliforniaThat second line is the Berkeley DNA still showing.
Eras
The Postgres95 era (Jul 1996 – mid 1996)
Tiny team, small codebase, original C with K&R-style declarations in places. Many features that are now considered table stakes (foreign keys, WAL, MVCC, real transactions) did not yet exist or were stubs. The first "fix" commits land within hours of the import: dropping tables with names longer than 16 characters, NULL handling in LIKE, segfaults in null-typed text fields. The project is in a hurry to grow up.
Foundations of the modern engine (1996 – ~2001)
A series of foundational subsystems are introduced in this period:
- MVCC lands (Vadim Mikheev, late 1990s) — the project's defining architectural choice. Visibility checks via
xmin/xmaxrow headers replace earlier locking-based concurrency. - WAL is added (Vadim, ~2001) for crash recovery. Before WAL, durability was a much weaker promise.
- The query optimizer is rebuilt around path/plan separation.
- PL/pgSQL is introduced as the primary procedural language.
- TOAST appears (~2001) so that wide values stop being constrained by the page size.
The "ship it everywhere" era (~2002 – ~2010)
Features pile in: schemas, savepoints, two-phase commit, GIST and GIN indexes, point-in-time recovery, table partitioning by inheritance, hot standby. The license is reaffirmed as a permissive BSD-style license. The release cadence stabilizes to roughly one major version per year.
Streaming and standardization (~2010 – ~2017)
PostgreSQL 9.0 (Sep 2010) ships streaming replication and hot standby in their modern form, replacing log shipping for most users. Subsequent releases bring synchronous replication, cascading replicas, and pg_basebackup. JSON and JSONB are added (9.2, 9.4). Background workers and parallel query infrastructure land. Logical decoding is introduced (9.4).
Modernization (~2017 – ~2022)
Native partitioning replaces inheritance-based partitioning (10–13). Logical replication graduates to a SQL-level publication/subscription model. The stats collector moves into shared memory (15). Just-in-time expression compilation lands. Configure flags tighten — for example, OIDs on user tables are removed in 12, and ICU becomes mandatory.
The contemporary era (~2023 – present)
The current period is dominated by:
- Async I/O. A new
src/backend/storage/aio/subsystem, withio_uring,worker, andposix_aiomethods. Visible in the source tree atsrc/backend/storage/aio/. - Logical replication maturation. Failover slots, two-phase decoding, parallel apply, and many bug fixes. The directory
src/backend/replication/logical/continues to see heavy traffic. - Optimizer refinements around planner cost models, partition pruning, and skip scans on B-tree indexes.
- Build system parity. Meson is now a fully supported build alongside autoconf, with Makefiles and
meson.buildfiles coexisting in every directory. - REPACK CONCURRENTLY and other DDL-friendly features are landing in the v18 development cycle.
Bug-fix backpatches continue to flow into the supported release branches (currently REL_17_STABLE, REL_16_STABLE, etc.) for five years per major version.
Longest-standing features
A few subsystems trace their lineage essentially unbroken to the early Berkeley codebase:
- The catalog system.
pg_class,pg_attribute,pg_proc,pg_type— the table-of-tables design predates the 1996 import. The catalog mechanics insrc/backend/catalog/and the bootstrap scripts insrc/backend/catalog/genbki.plcarry direct descendants of original Berkeley code. - The rule system. PostgreSQL's view implementation is built on the Berkeley "rules system" (
src/backend/rewrite/). The query rewriter is one of the few subsystems that have looked architecturally similar for 25+ years. - The fmgr / function call interface. The dispatch mechanism in
src/backend/utils/fmgr/is old; the V1 calling convention is essentially unchanged since the 1990s. - Datum and Node. The two foundational types of the engine —
Datum(the runtime value) andNode(the tagged-union of every parser/planner tree node) — are pervasive and basically immutable design choices.
Deprecated and replaced features
A list of things that were once first-class and are no longer:
- Inheritance-based partitioning. Long the only way to partition, replaced by declarative partitioning in 10–11. Inheritance still exists for general use but the declarative system is the recommended path.
- Recovery via
recovery.conf. Therecovery.conffile was the way to configure standbys for many years; in PostgreSQL 12 (2019) it was replaced by GUCs inpostgresql.confand trigger files (recovery.signal,standby.signal). pg_resetxlog. Renamed topg_resetwalin 10. The "xlog" term across the source tree was renamed to "wal" at the same time. References toxloglinger in some functions and file names because renaming everything would break compatibility.- OIDs on user tables. Removed in PostgreSQL 12. The
WITH OIDSclause is now an error. - Stats collector process. The dedicated stats collector daemon was removed in 15; cumulative statistics now live in shared memory.
pg_xlog/. Renamed topg_wal/in 10 to make it less tempting for sysadmins to "free up disk" by deleting the directory.createlang/droplang. Removed; useCREATE EXTENSION/DROP EXTENSION.pg_dumpall --globals-onlyformatting changes, sequence handling rewrites, and other dump-format incremental shifts have come and gone but are mostly invisible to end users.
The doc/src/sgml/appendix-obsolete-*.sgml files in this repo enumerate features that have explicitly been declared obsolete; they are kept as appendices so that older docs continue to make sense.
Major rewrites
A non-exhaustive list of large internal rewrites:
| Era | Rewrite |
|---|---|
| 2001 | Introduction of WAL replaces an earlier ad-hoc durability story. |
| 2005-2006 | Win32 native port — adding a Windows backend without forking the codebase. |
| 2008-2010 | Streaming replication + hot standby replace log shipping as the canonical replication story. |
| 2014 | Logical decoding infrastructure introduced; later the substrate of logical replication (10) and many CDC tools. |
| 2017-2018 | Declarative partitioning replaces inheritance partitioning as the recommended approach. |
| 2017 | Parallel query — the executor learns to spawn workers and aggregate their output. |
| 2018-2020 | JIT (LLVM-based expression compilation) added in 11; tuple-deforming JIT in 12. |
| 2022-2023 | Stats collector moves into shared memory (15). |
| 2023-2026 | Async I/O (src/backend/storage/aio/) — an ongoing rewrite of how the buffer manager issues reads and writes. |
Growth trajectory
By contributor count, the project has been growing steadily but slowly: a small core of committers (a few dozen at any time) supported by hundreds of patch authors per year on pgsql-hackers. The top committers by raw count over the project's history are Tom Lane, Bruce Momjian, Peter Eisentraut, Michael Paquier, Álvaro Herrera, Heikki Linnakangas, Robert Haas, Andres Freund, Noah Misch, and Andrew Dunstan — all of whom remain active.
By directory growth: src/backend/replication/logical/ is among the most recently expanded subsystems. src/backend/storage/aio/ did not exist a few releases ago. The contrib/ tree has grown more slowly because new optional functionality is now usually shipped as out-of-tree extensions on PGXN rather than absorbed into core.
For a quantitative snapshot today, see By the numbers.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.