---
title: "A 6502 CPU emulator entirely in Postgres"
publication: "Postgres Weekly"
issue: 644
published_at: "2026-04-15"
canonical_url: "https://postgresweekly.com/issues/644"
---

Plus making materialized view refreshes more efficient, putting the Linux kernel into Postgres (kinda), and rotating credentials in production.        

#​644 — April 15, 2026 

[Web Version](https://postgresweekly.com/issues/644)  

Together with [![Tiger Data logo\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,w_1280,h_282/e_make_transparent/co_white,e_outline:30/px1u7kjyvz7xnbm6ytir.png)](https://www.tigerdata.com/timescaledb?utm_source=content-syndication&utm_medium=referral&utm_campaign=postgres-weekly-newsletter)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/rprmypqe54vw7gcclpxq.jpg)](https://planetscale.com/blog/keeping-a-postgres-queue-healthy)  

[Keeping a Postgres Queue Healthy](https://planetscale.com/blog/keeping-a-postgres-queue-healthy) — Running a job queue in Postgres works well ([“just use Postgres!”](https://www.tigerdata.com/blog/its-2026-just-use-postgres)) until long-running analytics queries silently prevent autovacuum from keeping up. Here’s what’s actually going on and what you can do about it, along with PlanetScale’s own in-house solution. 

Simeon Griggs (PlanetScale)   [![\](https://res.cloudinary.com/cpress/image/upload/c_limit,w_480,h_480,q_auto/copm/83704dc0.png)](https://www.tigerdata.com/timescaledb?utm_source=content-syndication&utm_medium=referral&utm_campaign=postgres-weekly-newsletter) 

[You Extend Postgres for Everything Else. Why Not Analytics?](https://www.tigerdata.com/timescaledb?utm_source=content-syndication&utm_medium=referral&utm_campaign=postgres-weekly-newsletter) — TimescaleDB adds hypertables, 95% compression, and continuous aggregates so Postgres handles analytics on live data. No second database, no pipeline, no new query language. Same SQL you already write. [Start building for free](https://www.tigerdata.com/timescaledb?utm_source=content-syndication&utm_medium=referral&utm_campaign=postgres-weekly-newsletter). 

Tiger Data (creators of TimescaleDB) sponsor   

[Making Materialized View Refreshes O(delta) Instead of O(total)](https://gist.github.com/Tostino/e61b0d78e875ae22767deb0ffa55d2e1) — Every time you refresh a [materialized view](https://www.postgresql.org/docs/current/rules-materializedviews.html), it recomputes the entire dataset, even if only a single row changed. A patch, [being discussed](https://www.postgresql.org/message-id/flat/CAMjNa7eFzTQ5%3DoZMQiB2bMkez5KP4A77JC7SRjeVEkOrh7cUHw%40mail.gmail.com) on `pgsql-hackers`, adds a `WHERE` clause to `REFRESH MATERIALIZED VIEW` so refreshes only touch rows that changed. This writeup includes trigger patterns for both immediate and deferred maintenance, useful even without the patch landing in core. 

Adam Brusselback   

💡 [pg_ivm](https://github.com/sraoss/pg_ivm) offers similar functionality as an extension, though with tighter restrictions on supported SQL syntax.  

[Understanding Postgres Wait Events](https://richyen.com/postgres/2026/04/13/wait_events.html) — When a query slows down or a database becomes CPU bound, Postgres already knows why. The `pg_stat_activity` view exposes _wait events_ that show exactly what each session is blocked on at any given moment. 

Richard Yen   

[Checkpoints, Write Storms, and You](https://www.pgedge.com/blog/checkpoints-write-storms-and-you) — When Postgres is forced to checkpoint early (typically when it hits `max_wal_size`), it drops its usual throttling and flushes aggressively, hammering disk I/O. The default 1GB WAL limit is a common trigger. 

Shaun Thomas (pgEdge)   

💡 In a follow-up, Jeremy Schneider notes checkpoints aren’t the only source of write storms: [setting `autovacuum_vacuum_cost_delay` to zero can trigger them too.](https://ardentperf.com/2026/04/12/zero-autovacuum_cost_delay-write-storms-and-you/)  

['I Imported the Linux Kernel into Postgres'](https://oseifert.ch/blog/linux-kernel-pgit) — A developer imported the full Linux kernel history into Postgres by way of [pgit](https://oseifert.ch/blog/building-pgit). A good stress test of `pgit` _and_ now you can `SELECT` your way through years of Linux kernel history. 

Oliver Seifert   

[The 1 GB Limit That Breaks `pg_prewarm` at Scale](https://stormatics.tech/blogs/the-1-gb-limit-that-breaks-pg_prewarm-at-scale) — [pg_prewarm](https://www.postgresql.org/docs/current/pgprewarm.html) can reload buffer caches after a restart to maintain performance. **But on Postgres 16 versions <16.10**, if `shared_buffers` is over ~429GB, pg_prewarm fails and makes the server unreachable. Here's why, and what to do about it. 

Warda Bibi   

📄 [Less Obvious Things to Know About Indexes](https://jon.chrt.dev/2026/04/15/things-you-didnt-know-about-indexes.html) – Quick insights into composite index ordering, function calls on columns, and indexing rows you’ll never query. Jon Charter 

📄 [Rotating Postgres Credentials in Production Without Downtime](https://www.elydb.com/blog/postgresql-credential-rotation-production) ElyDB Team 

📄 [Waiting for Postgres 19: New `pg_get_*_ddl()` Functions](https://www.depesz.com/2026/04/09/waiting-for-postgresql-19-new-pg_get__ddl-functions/) Hubert Lubaczewski    

**RELEASES AND CODE:**   

[`pg_6502`: A 6502 CPU Emulator Running Entirely Inside Postgres](https://github.com/lasect/pg_6502) — Every CPU register, every flag, and 64KB of memory are Postgres tables; [every 6502 opcode is a stored procedure.](https://github.com/lasect/pg_6502/blob/main/init/04_opcodes.sql) A fun hack showcasing how far you can push PL/pgSQL. 

lasect   

💳 [Supabase Transfers the _Stripe Sync Engine_ to Stripe](https://supabase.com/blog/stripe-sync-engine-transfer) — [Stripe Sync Engine](https://github.com/stripe/sync-engine), originally created by Supabase as a way to synchronize a Stripe account with a Postgres database, is now an official Stripe project. 

Supabase   

[Skunk 1.0: A Pure Functional Postgres Driver for Scala](https://github.com/typelevel/skunk/releases/tag/v1.0.0) — [Skunk](https://typelevel.org/skunk/) is a pure functional, non-blocking Postgres driver for Scala that now supports Scala 2.13 and 3 across JVM, JS, and [Scala Native 0.5.](https://scala-native.org/en/latest/) 

Michael Pilquist (Typelevel)   

- 🔎 [pg_wait_tracer 0.8](https://github.com/DmitryNFomin/pg_wait_tracer) – eBPF-based wait event tracer that watches Postgres at the kernel level instead of polling `pg_stat_activity`.
- [pgcollection 2.0](https://mlodgenski.blogspot.com/2026/04/pgcollection-20-integer-keys-range.html) – Associative array data types for PL/pgSQL, modeled after Oracle PL/SQL's equivalent feature. ([GitHub repo.](https://github.com/aws/pgcollection))
- 🔒 [column_encrypt 4.0](https://github.com/vibhorkum/column_encrypt) – Transparent column-level encryption using AES, with custom encrypted data types.
- [pg_datasentinel 1.0](https://github.com/datasentinel/pg_datasentinel) – Extension that enriches `pg_stat_activity` and adds observability views.
- 🌐 [PostGIS Patch Releases](https://postgis.net/2026/04/PostGIS-Patch-Releases/) – Bug fix and security releases for PostGIS 3.2-3.6.
- 🟧 [hn-fdw](https://github.com/tamnd/hn-fdw) – Foreign data wrapper for querying an archive of [Hacker News](https://news.ycombinator.com/news).
- [pgAdmin 4 v9.14](https://www.pgadmin.org/docs/pgadmin4/9.14/release_notes_9_14.html) – Popular GUI admin tool for Postgres.
- [CloudNativePG 1.29.0](https://www.postgresql.org/about/news/cloudnativepg-1290-released-3266/)
- [pg_clickhouse 0.2](https://justatheory.com/2026/04/pg_clickhouse-0.2.0/)    

**Got a new email?** You can [change your address here](https://postgresweekly.com/edit_subscription/*|UID|*). 

--- 

**Bored of us?** [Click here to stop getting Postgres Weekly](https://postgresweekly.com/leave/*|UID|*). 

--- 

**Got a link for us?** Reply and tell us. We can't include everything but we'll look at anything you send. _Thanks!_ 

--- 

Published by Cooper Press Ltd.
Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom 

Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada. 

[Stop getting this newsletter](https://postgresweekly.com/leave/*|UID|*).
