June 30, 2026

Dirty little secrets of your database

Reading the internals of Postgres: Database cluster, databases, and tables

Postgres gets an x-ray, and readers are equal parts amazed and terrified

TLDR: The article explains that PostgreSQL stores databases, tables, and other internals in a surprisingly organized folder-and-record system, and that “cluster” means one server managing many databases, not many servers. Readers reacted with awe and mild fear, joking that the real wizards are the people working close to the operating system.

A seemingly calm deep dive into how PostgreSQL stores its stuff turned into a very relatable internet mood: wow, computers are way scarier under the hood than I wanted to know. The post walks readers through a basic but important idea: in PostgreSQL, a “cluster” doesn’t mean a bunch of machines working together like many people expect. It actually means one PostgreSQL server managing a group of databases. From there, the author peels back the layers, showing that databases, tables, indexes, and even built-in features are tracked like entries in internal lists, all living inside a big data folder set up when PostgreSQL is installed.

And the community response? Pure existential awe. The standout reaction came from commenter TheColorYellow, who basically voiced what a lot of less low-level programmers feel: once you get past writing simple database commands, you fall into a rabbit hole of memory pages, pointers, overflow handling, and operating-system magic. Translation for normal humans: the stuff that makes databases work is wildly complicated, and many readers were half fascinated, half grateful they usually never have to touch it. That became the hot take of the thread: real programming glory might not be in fancy app code at all, but in the gritty systems work hidden below. It’s not exactly a flame war, but it is a classic programmer identity crisis — with a side of respectful panic and the usual “I’m blessed to not worry about this” energy.

Key Points

  • In PostgreSQL, a database cluster means a group of databases managed by one PostgreSQL instance, not a multi-node server cluster.
  • Databases and other objects in PostgreSQL are represented by OIDs, with built-in objects using low values and user-created objects starting from 16384.
  • System catalogs such as `pg_class`, `pg_database`, and `pg_index` are regular PostgreSQL tables that store metadata about database objects.
  • The article outlines the history of automatic OID generation for table rows: enabled by default through PostgreSQL 8.0, opt-in from 8.1 to before 12, and removed in 12 and later.
  • A PostgreSQL cluster stores its files in the directory specified by `PGDATA`, which is initialized by `initdb`; the article also notes storage layout changes such as `current_logfiles` being added in PostgreSQL 10.

Hottest takes

"True programming seems to lie in the OS" — TheColorYellow
"I am blessed to not worry about" — TheColorYellow
"memory-management tricks" — TheColorYellow
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.