postgres/postgres
Glossary
PostgreSQL has its own vocabulary, much of it inherited from the original Berkeley Postgres research project. This glossary collects the terms a reader of this wiki — or the source code — needs to know.
Server processes
Postmaster. The supervisor process that listens for connections and forks a backend per client. It is just postgres invoked as a daemon. Source: src/backend/postmaster/postmaster.c.
Backend. A per-connection server process. Implements the SQL main loop in src/backend/tcop/postgres.c (PostgresMain).
Auxiliary process. Any non-backend child of the postmaster: WAL writer, checkpointer, background writer, autovacuum, logical replication launcher, etc. See Postmaster and process model.
Background worker (bgworker). A user-defined process spawned by the postmaster. Used by parallel query, logical replication apply workers, and many extensions.
Storage and tuples
Heap. The default table storage format. A heap is a sequence of 8 KB pages of HeapTuple rows. The "heap access method" (src/backend/access/heap/heapam.c) implements it. PostgreSQL has a pluggable Table Access Method API, so other heaps are possible, but heap is the only in-tree implementation.
Page / Block. An 8 KB unit of disk I/O. The page layout (src/include/storage/bufpage.h) is shared by heap and index pages: header, line pointers (ItemIds) growing from the front, tuples growing from the back, free space in the middle.
Tuple. A row. On disk a HeapTuple consists of a header (HeapTupleHeader — xmin, xmax, cmin, cmax, infomask flags, OIDs, ctid, null bitmap) followed by the column values.
TID / ctid. Tuple identifier: (block number, item offset) pointing to a tuple's location in its heap.
Toast. "The Oversized Attribute Storage Technique" — values larger than ~2 KB are compressed and split across rows of a side table (pg_toast.pg_toast_<oid>). Source: src/backend/access/common/toast_*.c and src/backend/access/table/toast_helper.c.
Free space map (FSM). Tracks free space per page, used to find a target page for INSERT. Source: src/backend/storage/freespace/.
Visibility map (VM). A bitmap of "all-visible" pages, used by index-only scans and to skip frozen pages during VACUUM. Source: src/backend/access/heap/visibilitymap.c.
Transactions and visibility
XID (Transaction ID). A 32-bit integer assigned to each writing transaction. Used to determine row visibility. Wraps every ~2 billion transactions; freezing prevents wraparound corruption.
MVCC. Multi-version concurrency control. Each row update creates a new version of the row; the old version is left in place (with xmax set) until VACUUM reclaims it. Readers see the version visible at the start of their transaction, never blocking writers.
Snapshot. The set of XIDs that are "in progress" from the perspective of a transaction. Used for visibility tests. Source: src/backend/storage/ipc/procarray.c, src/backend/utils/time/snapmgr.c.
CLOG (commit log). A 2-bit-per-XID array recording whether each transaction committed, aborted, or is in progress. Source: src/backend/access/transam/clog.c.
SLRU. Simple LRU. A small fixed-page cache for things like CLOG, multixact, async-commit pages. Source: src/backend/access/transam/slru.c.
Multixact. A grouping of XIDs used when multiple transactions hold a row lock simultaneously (e.g., shared row lock + update). Source: src/backend/access/transam/multixact.c.
HOT (Heap-Only Tuple). An update that doesn't modify any indexed column; the new version is chained off the old one and indexes don't need to be touched.
VACUUM. The maintenance operation that reclaims dead tuples and updates the FSM/VM. Autovacuum runs it automatically.
WAL and recovery
WAL. Write-Ahead Log. Every change to a buffer page is logged to pg_wal/ before the change is flushed to disk, ensuring crash recovery can rebuild state. Source: src/backend/access/transam/xlog.c.
LSN. Log Sequence Number. A 64-bit byte offset into the WAL stream. Pages carry the LSN of the last WAL record that modified them.
Resource manager (rmgr). WAL records are tagged by resource manager: heap, btree, gin, transaction, etc. Each rmgr provides redo/desc functions. See src/include/access/rmgrlist.h.
Checkpoint. A point at which all dirty buffers prior to a given LSN have been written to disk, so recovery can start from there. Source: src/backend/postmaster/checkpointer.c.
Restore point. A named LSN used as a target for point-in-time recovery (PITR).
Catalog and naming
OID. Object identifier. A 32-bit integer assigned to every catalog row. Pinned OIDs (those below FirstUnpinnedObjectId, currently 12000) are baked into the source.
System catalog. A regular table whose name starts with pg_ and that stores metadata. pg_class (relations), pg_attribute (columns), pg_proc (functions), pg_type (types), etc. See Catalog.
Relation. Anything that has rows: a table, view, index, sequence, materialized view, partitioned table. Represented at runtime by a Relation (a.k.a. RelationData) struct.
Datum. The runtime value of a column or expression. A Datum is a uintptr_t that holds the value directly for pass-by-value types and a pointer for pass-by-reference. Source: src/include/postgres.h.
fmgr. Function manager. Calls user-defined and built-in functions through a uniform interface (FunctionCallInfo). Source: src/backend/utils/fmgr/.
Query pipeline
Parse tree (RawStmt). Output of bison; Node-based tree. Source: src/backend/parser/gram.y.
Query. The post-analysis representation: names resolved against the catalog, types fixed. Produced by parse_analyze.
Plan / Plan tree (PlannedStmt). The output of the optimizer. A tree of Plan nodes (Seq Scan, Hash Join, Sort, etc.) executed top-down, pull-style.
Path. The optimizer's intermediate representation of a possible plan; carries cost estimates. Multiple paths per relation are considered before the cheapest is converted to a Plan.
RTE (Range Table Entry). An entry in the Query's range table — typically a relation, a join, a subquery, a CTE. Identified by 1-based index.
Tuplestore / Tuplesort. In-memory + spill-to-disk infrastructures for buffered tuples (e.g., for sorts, materializes, set-returning functions). Source: src/backend/utils/sort/.
Portal. An executor instance bound to a cursor or active query. Source: src/backend/utils/mmgr/portalmem.c.
Concurrency primitives
LWLock. Lightweight lock — a shared/exclusive latch protecting a shared-memory data structure. Source: src/backend/storage/lmgr/lwlock.c.
Heavy lock / Lock manager. Hash-table-backed locks with deadlock detection used for relations, rows, advisory locks. Source: src/backend/storage/lmgr/lock.c.
ProcArray. Shared array of PGPROC entries, one per backend, used for snapshots and signaling. Source: src/backend/storage/ipc/procarray.c.
Latch. Cross-process condition variable. A backend WaitLatches; another process SetLatches to wake it. Source: src/backend/storage/ipc/latch.c.
Replication
WAL sender / WAL receiver. Streaming replication endpoints. Source: src/backend/replication/walsender.c, walreceiver.c.
Replication slot. Server-side state that records which WAL a downstream consumer has confirmed; lets the primary refuse to recycle WAL the consumer still needs. Source: src/backend/replication/slot.c.
Logical decoding. Reads WAL and reconstructs INSERT/UPDATE/DELETE change records. Used by logical replication and CDC tools. Source: src/backend/replication/logical/.
Publication / Subscription. SQL-level objects that drive logical replication: a publication describes what to replicate, a subscription consumes it.
Configuration
GUC. "Grand Unified Configuration" parameter — anything settable via postgresql.conf, SET, or command line. Source: src/backend/utils/misc/guc.c, guc_tables.c.
Tablespace. A directory where one or more relations live. Default tablespace points at $PGDATA/base/.
Database, schema, role. Standard SQL terms. Roles serve as both users and groups (the distinction was removed in 8.1).
Wire and tooling
libpq. The official C client library. Source: src/interfaces/libpq/.
Frontend / Backend protocol. PostgreSQL's wire protocol (currently version 3). Documented in doc/src/sgml/protocol.sgml. The frontend code parses messages in pqcomm.c/pqformat.c; backend dispatch is in src/backend/tcop/postgres.c.
TAP test. A Perl test based on the Test Anything Protocol. PostgreSQL ships a harness in src/test/perl/PostgreSQL/Test/.
pgindent. The code formatter. Source: src/tools/pgindent/. The version-controlled typedefs.list lists project typedef names so the formatter knows them.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.