PostgreSQL: Silent Data Loss Bug Fixed in GIN Indexes

A single commit from Peter Geoghegan fixes a long-standing bug in GIN posting tree page deletion that could cause index scans to silently miss data. The fix mirrors a known-good pattern from B-tree indexes and is being backpatched all the way to PostgreSQL 14.

Duration: PT2M9S

Episode overview

This episode is a short developer briefing from PostgreSQL.

It explains recent repository work in plain language.

  • Show: PostgreSQL
  • Published: 2026-08-23T13:02:58Z
  • Audio duration: PT2M9S

Transcript excerpt

This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.

Good morning. It's August 23rd, and this is your PostgreSQL briefing.

Today's headline is a single commit, but it addresses a serious correctness bug: GIN indexes could silently drop tuples from scans under a specific, hard-to-hit condition.

Here's what happened. When PostgreSQL deletes a page in a GIN posting tree, it needs to find that page's left sibling by walking the parent's downlinks. The bug: if a page split was left incomplete, the new right half of that split has no downlink yet, but it's still part of the sibling chain. Page deletion didn't…

Peter Geoghegan's fix, in commit f20c427, teaches GIN's page deletion logic to check whether the target page's left sibling, or the target itself, is marked as incompletely split, and to back off in those cases. This is essentially porting a defense that already exists in B-tree index deletion over to GIN's posting…

Two details are worth flagging for anyone tracking this. First, the bug was found by Claude Code, and the test case in the commit is a simplified version of one it wrote. That's a notable data point on AI-assisted bug hunting finding real, subtle concurrency-adjacent bugs in core index code. Second, this is being…

What's…

Nearby episodes from PostgreSQL

  1. TOAST Vacuum Fix and Planner Correctness Patches
  2. Cleaning Up the Node Reading Internals
  3. Weekly Recap - Correctness Fixes and Internal Cleanup
  4. Subtransaction Edge Cases and Long-Overdue Cleanup
  5. Trusting Input, Fixing Silent Failures
  6. A Deep Dive Into Data Corruption Fixes
  7. Query Planner Gets Smarter About Nulls
  8. Closing the Gaps on Concurrent Race Conditions