---
title: "Posts"
description: "Engineering blog posts from companies, open source projects, research labs and engineers, each with a summary, topics and a difficulty level."
url: "https://swe.quest/?difficulty=hard&per=96&tag=postgres"
---

# Posts

Filtered by topics: PostgreSQL, difficulty: hard.

Posts 1–29 of 29, page 1 of 1, newest first.

## 2026-11-17

- [More load is faster: Tuning Postgres read replicas](https://swe.quest/articles/more-load-is-faster-tuning-postgres-read-replicas-edfe2bbdc0de0a5f.md): ClickHouse · 2026-11-17 · Hard · 9 min read · PostgreSQL, Replication, Performance engineering
  Postgres read replicas fed from archived WAL (rather than streaming replication) show a U-shaped lag curve: idle systems wait up to archive\_timeout (60s) for a 16MB segment to fill, while very high write rates make archive upload fall behind.

## 2026-11-05

- [Designing a reliable unplanned failover](https://swe.quest/articles/designing-a-reliable-unplanned-failover-ab0dd731f569d08c.md): PlanetScale · 2026-11-05 · Hard · 10 min read · PostgreSQL, Replication, Resilience, Distributed systems, Distributed databases
  Neki, PlanetScale's Postgres sharding system, declares a primary dead only when its control plane (Admin) cannot reach it and at least one reachable replica reports broken replication with none contradicting.

## 2026-11-04

- [Fencing a Postgres primary that might still be alive](https://swe.quest/articles/fencing-a-postgres-primary-that-might-still-be-alive-67043bdd5aea0f6c.md): ClickHouse · 2026-11-04 · Hard · 10 min read · PostgreSQL, Replication, Resilience, Networking, Cloud platforms
  Before promoting a standby, a managed Postgres control plane must fence the old primary, because promotion and DNS changes alone don't stop writes: async standbys, per-session synchronous\_commit overrides, quorum commit with a remaining standby, and canceled commits already in WAL can all let a still-alive primary accept writes.

## 2026-10-29

- [Designing a planned switchover for minimum disruption](https://swe.quest/articles/designing-a-planned-switchover-for-minimum-disruption-c09f9387b5a40465.md): PlanetScale · 2026-10-29 · Hard · 8 min read · PostgreSQL, Replication, Resilience, Deployment
  Neki performs planned Postgres primary switchovers without stopping the old primary.

## 2026-10-14

- [Sequences and other volatiles in Neki](https://swe.quest/articles/sequences-and-other-volatiles-in-neki-867c9857ecacbacb.md): PlanetScale · 2026-10-14 · Hard · 14 min read · Query engines, PostgreSQL, Distributed databases, SQL
  Neki, PlanetScale's sharded Postgres, implements Postgres sequences by classifying sequence operations like nextval() as router-only, with an authoritative shard hosting all sequences so values are never duplicated across shards.

## 2026-10-06

- [How savepoints quietly throttled our Postgres queue](https://swe.quest/articles/how-savepoints-quietly-throttled-our-postgres-queue-a32737dd90a62c34.md): incident.io · 2026-10-06 · Hard · 15 min read · PostgreSQL, Performance engineering, Storage engines, Concurrency, Scaling
  Using a SAVEPOINT per tick in a Postgres-backed job queue made every locked row carry a MultiXact ID in xmax.

## 2026-10-01

- [Building a faster, lazier router for Postgres](https://swe.quest/articles/building-a-faster-lazier-router-for-postgres-bc9a70ce219128ed.md): PlanetScale · 2026-10-01 · Hard · 15 min read · PostgreSQL, Distributed databases, Performance engineering, Go, Query engines
  Neki, PlanetScale's Postgres sharding router, cuts per-query overhead by keeping PostgreSQL wire-protocol bytes intact and decoding only as much as each query requires.

## 2026-09-30

- [Memory safety for Postgres extensions in C/C++](https://swe.quest/articles/memory-safety-for-postgres-extensions-in-c-c-b6883b8eb3b1e33d.md): ClickHouse · 2026-09-30 · Hard · 4 min read · PostgreSQL, Memory safety, C & C++, Memory management
  Postgres's palloc/MemoryContext allocation and setjmp/longjmp-based error handling clash with C++ new/delete, destructors and exceptions: longjmp skips destructors (undefined behavior), exceptions bypass PG\_CATCH, and an uncaught exception aborts the process and forces cluster-wide crash recovery.

## 2026-09-28

- [Can your Postgres survive a bad query?](https://swe.quest/articles/can-your-postgres-survive-a-bad-query-744ea9a22b65710c.md): ClickHouse · 2026-09-28 · Hard · 13 min read · PostgreSQL, Memory management, Resilience, Query engines, Linux
  Postgres's \`work\_mem\` limits memory per plan node per process, not per query, so parallel workers and \`hash\_mem\_multiplier\` can push a simple aggregation past 8x \`work\_mem\`.

## 2026-09-09

- [Improving Lakebase Postgres Compute Cache on Neon, Part 1](https://swe.quest/articles/improving-lakebase-postgres-compute-cache-on-neon-part-1-96696f73ade727a0.md): Neon · 2026-09-09 · Hard · 9 min read · PostgreSQL, Caching, Performance engineering, Memory management, Virtualization
  On large fixed-size Lakebase Postgres computes, Neon now disables its NVMe-backed local file cache and sets shared buffers to 75% of DRAM (up from a 1 GB cap), backed by explicit 2 MB HugeTLB pages provisioned through host, hypervisor and guest VM.

## 2026-08-31

- [Autoscaling Lakebase Postgres](https://swe.quest/articles/autoscaling-lakebase-postgres-63257ef0753db067.md): Neon · 2026-08-31 · Hard · 12 min read · PostgreSQL, Capacity planning, Virtualization, Algorithms, Kubernetes
  Neon's Lakebase Postgres resizes compute in place about once every 81 seconds by taking the maximum of three target sizes: CPU load (one-minute average kept under 90%), memory (polled every 100 ms by an in-VM monitor and kept under 75%), and the working set of the compute cache.

## 2026-08-24

- [WAL + S3: Lakebase storage for the era of agents](https://swe.quest/articles/wal-s3-lakebase-storage-for-the-era-of-agents-3f04922da0e40ff3.md): Neon · 2026-08-24 · Hard · 15 min read · PostgreSQL, Storage engines, Storage systems, Data structures, Replication
  Lakebase Postgres (Neon's architecture) treats the Postgres write-ahead log as the source of truth and data pages as a derived cache, splitting the system into stateless compute running unmodified Postgres and a storage layer of Paxos-replicated safekeepers, pageservers, and S3.

## 2026-08-11

- [What's new in pg\_clickhouse v0.10.0: Subqueries, TPC-H Speedups, C Driver, and Aggregates](https://swe.quest/articles/what-s-new-in-pg-clickhouse-v0-10-0-subqueries-tpc-h-speedups-c-driver-and-178ced76a7784be7.md): ClickHouse · 2026-08-11 · Hard · 11 min read · PostgreSQL, Query engines, Analytics & OLAP, SQL, Performance engineering
  pg\_clickhouse v0.10.0 pushes correlated scalar subqueries, IN and NOT IN down to ClickHouse as remote subqueries and anti/semi-joins, raising full TPC-H pushdown from 12 to 16 of 22 queries.

## 2026-08-05

- [What is WAL backpressure, and why does ClickHouse Managed Postgres need it?](https://swe.quest/articles/what-is-wal-backpressure-and-why-does-clickhouse-managed-postgres-need-it-a02421af1a627e86.md): ClickHouse · 2026-08-05 · Hard · 4 min read · PostgreSQL, Resilience, Linux, Storage systems
  ClickHouse Managed Postgres prevents WAL-full PANICs, which happen when writes outpace archiving to object storage, by throttling client write bandwidth with the cgroup v2 I/O controller.

## 2026-05-14

- [Postgres FDW: Pushdown is a negotiation](https://swe.quest/articles/postgres-fdw-pushdown-is-a-negotiation-623facded31963c6.md): ClickHouse · 2026-05-14 · Hard · 16 min read · PostgreSQL, Query engines, Analytics & OLAP, Performance engineering
  pg\_clickhouse, a Postgres foreign data wrapper for ClickHouse, decides clause by clause how much of a query to push down as ClickHouse SQL.

## 2026-05-07

- [Everyone gets faster writes: We turned off FPW's in Neon](https://swe.quest/articles/everyone-gets-faster-writes-we-turned-off-fpw-s-in-neon-60d0cd25f29077e7.md): Neon · 2026-05-07 · Hard · 7 min read · PostgreSQL, Storage engines, Performance engineering, Distributed databases
  Neon disabled Postgres full-page writes fleet-wide because its stateless compute streams WAL to a Paxos safekeeper quorum and has no local disk pages that can tear.

## 2026-02-13

- [pg\_stat\_ch: a PostgreSQL extension that exports every metric to ClickHouse](https://swe.quest/articles/pg-stat-ch-a-postgresql-extension-that-exports-every-metric-to-clickhouse-44a394f2889686fc.md): ClickHouse · 2026-02-13 · Hard · 16 min read · PostgreSQL, Observability, Performance engineering, Concurrency, Analytics & OLAP
  pg\_stat\_ch is an open-source (Apache 2.0) PostgreSQL 16–18 extension that captures every statement execution, including failed queries and DDL, as a fixed-size ~4.6KB event with 45 fields and streams it to ClickHouse for APM-style analysis.

## 2025-12-18

- [Contributing to Debezium: Fixing Logical Replication at Scale](https://swe.quest/articles/contributing-to-debezium-fixing-logical-replication-at-scale-9a91b621ec2af98e.md): Zalando Engineering · 2025-12-18 · Hard · 9 min read · PostgreSQL, Event-driven architecture, Replication, Open source, Data pipelines
  Zalando contributed two configuration options to Debezium's PostgreSQL connector, released in 3.4.0.Final.
- [Taming PostgreSQL GUC “extra” Data](https://swe.quest/articles/taming-postgresql-guc-extra-data-7e376007c1715e0d.md): ClickHouse · 2025-12-18 · Hard · 8 min read · PostgreSQL, C & C++, Memory management, Configuration management
  PostgreSQL GUC check and assign hooks can pre-parse a custom string setting into a structured value, but only if the "extra" data follows the GUC API's memory rules.

## 2025-07-15

- [Recent Storage Performance Improvements at Neon](https://swe.quest/articles/recent-storage-performance-improvements-at-neon-e29e2d9302293c1f.md): Neon · 2025-07-15 · Hard · 8 min read · PostgreSQL, Storage engines, Performance engineering, Distributed databases, Storage systems
  Neon shipped a set of storage-layer optimizations across Safekeepers and Pageservers.

## 2025-07-08

- [When SIGTERM Does Nothing: A Postgres Mystery](https://swe.quest/articles/when-sigterm-does-nothing-a-postgres-mystery-0ecf6df7cd549d22.md): ClickHouse · 2025-07-08 · Hard · 11 min read · PostgreSQL, Replication, Debugging, Event-driven architecture
  Creating a logical replication slot on a Postgres hot standby (v16+) can hang indefinitely and ignore pg\_cancel\_backend and pg\_terminate\_backend when a transaction is still open on the primary.

## 2025-05-08

- [PostgreSQL Event Triggers without superuser access](https://swe.quest/articles/postgresql-event-triggers-without-superuser-access-1e29cc1decfb7891.md): Supabase · 2025-05-08 · Hard · 3 min read · PostgreSQL, Security, Identity & auth
  Supabase's supautils extension lets non-superusers create Postgres Event Triggers by intercepting \`create event trigger\` from a "privileged role" via ProcessUtility\_hook, temporarily elevating to superuser for creation, then assigning ownership back to the privileged role.

## 2025-01-15

- [Unraveling a Postgres segfault that uncovered an Arm64 JIT compiler bug](https://swe.quest/articles/unraveling-a-postgres-segfault-that-uncovered-an-arm64-jit-compiler-bug-3a4fc2ffe09ef0c2.md): Datadog Engineering · 2025-01-15 · Hard · 19 min read · PostgreSQL, Compilers, Debugging, Hardware, Incidents & postmortems
  Postgres crashes with segfaults on Arm64 instances were traced to JIT-compiled tuple-deforming code, and ultimately to a bug in LLVM's Arm64 code generation.

## 2024-04-15

- [1 Year of Autoscaling Postgres: How it’s going, and what’s next](https://swe.quest/articles/1-year-of-autoscaling-postgres-how-it-s-going-and-what-s-next-a75ce75d92118903.md): Neon · 2024-04-15 · Hard · 8 min read · PostgreSQL, Virtualization, Capacity planning, Memory management, Kubernetes
  Neon autoscales Postgres by running each instance as a VM in Kubernetes (NeonVM), with a per-node autoscaler-agent, a modified scheduler, and an in-VM vm-monitor that resizes the Local File Cache.

## 2023-12-08

- [Postgres Language Server: implementing the Parser](https://swe.quest/articles/postgres-language-server-implementing-the-parser-3a3e33745c9c0915.md): Supabase · 2023-12-08 · Hard · 14 min read · PostgreSQL, Compilers, Rust, Developer tools, SQL
  A Postgres language server's parser builds on libpg\_query rather than a custom grammar, and has to work around two gaps in it.

## 2023-05-19

- [Persistent Structures: Key to 2000x Speedup in Neon’s WAL Indexing](https://swe.quest/articles/persistent-structures-key-to-2000x-speedup-in-neon-s-wal-indexing-ca3203d56783f4cb.md): Neon · 2023-05-19 · Hard · 10 min read · Data structures, Storage engines, PostgreSQL, Rust, Performance engineering
  Neon's pageserver must answer GetPage(key, LSN) by finding, for a point in key–LSN space, the first image or delta layer rectangle directly below it, across tens of millions of layers.

## 2023-03-30

- [Deep dive into Neon storage engine](https://swe.quest/articles/deep-dive-into-neon-storage-engine-efc0ffc53406f34d.md): Neon · 2023-03-30 · Hard · 7 min read · Storage engines, PostgreSQL, Distributed databases, Serverless, Replication
  Neon's storage engine separates Postgres compute from storage and serves pages through GetPage@LSN, reconstructing any page as of any log sequence number from immutable layer files.

## 2022-08-02

- [Why does Neon use Paxos instead of Raft, and what’s the difference?](https://swe.quest/articles/why-does-neon-use-paxos-instead-of-raft-and-what-s-the-difference-f6a04ce40b5e85a1.md): Neon · 2022-08-02 · Hard · 14 min read · Consensus, Replication, PostgreSQL, Distributed databases, Formal methods
  Neon replaces Postgres's storage layer with distributed storage, so stateless compute nodes act as Paxos proposers and a fixed set of disk-backed safekeepers act as acceptors.

## 2021-07-02

- [Protecting reserved roles with PostgreSQL Hooks](https://swe.quest/articles/protecting-reserved-roles-with-postgresql-hooks-2e21a72630349824.md): Supabase · 2021-07-02 · Hard · 10 min read · PostgreSQL, Identity & auth, C & C++, Multi-tenancy
  Supabase grants customers the CREATEROLE privilege while preventing them from altering or dropping its internal service roles (like supabase\_storage\_admin) via a C extension, SupaUtils, that hooks PostgreSQL's ProcessUtility\_hook.

Same list as RSS: [https://swe.quest/feed.xml?difficulty=hard&tag=postgres](https://swe.quest/feed.xml?difficulty=hard&tag=postgres). Lists take `?page=`, `?per=12|24|48|96` and, on the home page, `?tag=` (up to 3), `?source=`, `?difficulty=easy|medium|hard` and `?search=`.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
