April 14, 2026

When SQL goes 8‑bit, drama goes 11

MOS tech 6502 8-bit microprocessor in pure SQL powered by Postgres

They put an 8‑bit brain in a database — geeks cheer, skeptics ask why

TLDR: A developer built a full 1970s 8‑bit CPU inside a Postgres database—tables as memory, little programs as instructions—and the crowd is split between awe and “but why?”. Fans love the retro flex and link similar projects, while pragmatists call it an impractical, delightful stunt that showcases creative engineering.

A developer just crammed a vintage 8‑bit CPU—the MOS 6502 from old Apple II and Nintendo days—into PostgreSQL, the popular database. Yes, really. In this project, the chip’s “brain” is made of tables and tiny programs inside the database, and the internet immediately split into two camps: delighted tinkerers and the why-would-you-do-this brigade.

Fans are calling it pure art: a “because we can” stunt that celebrates retro tech. One commenter even dared the ultimate reverse challenge: run Postgres on a real 6502 using Microsoft’s old BASIC. Meanwhile, the pragmatists showed up with a reality check: as one explainer put it, it basically stores 64KB of RAM in a table, keeps the chip’s registers in a single-row table, and uses built‑in procedures to play CPU—clever, but not exactly fast. The vibe: nerdy, nostalgic, and gloriously unnecessary.

The thread became a mini‑museum tour, with links to a Kim‑1 emulator and even a pocket calculator written as 6502 code. Jokes flew about writing “SELECT” statements to fetch pixels, and the performance police asked if it can run Doom (spoiler: no). Still, the crowd agrees: between pg_6502 and the Kim‑1 curios, this is the kind of ridiculous genius the internet lives for.

Key Points

  • pg_6502 emulates the MOS 6502 CPU entirely within PostgreSQL.
  • CPU registers/flags and 64KB memory are modeled as database tables (pg6502.cpu and pg6502.mem).
  • Each 6502 opcode is implemented as a stored procedure.
  • Quick start uses Docker and make commands to load schema and run the Klaus 6502 Functional Test.
  • Requirements include PostgreSQL 16+ and Docker; the project is MIT-licensed.

Hottest takes

How about Postgres on MOS tech 6502 8-bit microprocessor powered by Microsoft's 6502 BASIC? — m000
uses a table to store 64 kilobytes of memory — Someone
Pocket calc as 6502 code — anthk
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.