PostgreSQL: Fixing the Substring Bug That Bit Back
Noah Misch delivered two important commits fixing a tricky bug in PostgreSQL's SUBSTRING() function that was causing errors with multibyte characters in toasted data. The fix improves how PostgreSQL handles character encoding validation and resolves spurious Valgrind errors, making the database more robust for international applications.
Duration: PT4M17S
Episode overview
This episode is a short developer briefing from PostgreSQL.
It explains recent repository work in plain language.
- Show: PostgreSQL
- Published: 2026-02-15T11:06:51Z
- Audio duration: PT4M17S
Transcript excerpt
This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.
Hey there, fellow code explorers! Welcome back to another episode of the PostgreSQL podcast. I'm your host, and wow, do we have an interesting debugging story for you today - February 15th, 2026. You know those bugs that seem simple on the surface but reveal layers of complexity once you start digging? That's…
So here's what happened in the PostgreSQL world today - no merged pull requests, but we got two absolutely crucial commits from Noah Misch that tell a fascinating story about multibyte character handling and the ripple effects of previous changes.
Let me paint you a picture. Imagine you're working with a database that stores text in multiple languages - maybe Japanese, with those beautiful UTF-8 characters that can take up to 3 bytes each. Now, you're using PostgreSQL's SUBSTRING function to extract just a portion of that text. Sounds straightforward, right?…
Here's where it gets interesting. Back in commit 1e7fe06c - and this is a perfect example of how changes in one part of a system can have unexpected consequences elsewhere - the PostgreSQL team made a change to pg_mbstrlen_with_len to make it throw an error if it encounters an incomplete character at the end of…
But…
Noah…
Nearby episodes from PostgreSQL
- Code Clarity and Speed Wins
- Switch Case Safety and Background Worker Improvements
- The ABI Evolution and System Cleanup
- Cleanup Chronicles - Small Fixes, Big Impact
- Sorting Gets a Speed Boost
- Spring Cleaning and Performance Polish
- Security Shield Activated
- Protocol Evolution and Ecosystem Stress Testing