QA
Intermediate LevelPostgreSQL

How does ICU Collation Provider solve glibc locale corruption during OS upgrades?

❓ Interview Prompt: Explain collation providers, libc vs ICU (`provider = icu`), glibc OS library upgrades, index corruption, and `reindex` requirement.

Historically, PostgreSQL relied on operating system glibc libraries for string collation. When Linux OS updates upgraded glibc, alphabetical sort order subtle shifts caused silent B-Tree index corruption!

The ICU Solution (Postgres 15+):

Postgres 15+ supports ICU ('provider = icu') as the default collation provider:

•
ICU maintains fixed, OS-independent string sorting rules, preventing index corruption during operating system upgrades!

Code Implementation Example

sql
-- Create database using ICU collation provider (Postgres 15+)
CREATE DATABASE appdb 
WITH LOCALE_PROVIDER = 'icu'
     ICU_LOCALE = 'en-US';
💡Creating a database with ICU collation provider to prevent OS glibc index corruption.
🎯 Interview Key Takeaway

Use ICU collation providers (provider = icu) in Postgres 15+ to protect B-Tree indexes from OS glibc upgrade corruption.

#ICU#Collation#glibc#Index Corruption#Intermediate
Back to all PostgreSQL Questions→

More PostgreSQL Interview Questions

Beginner LevelPostgreSQL

How to use pgvector in PostgreSQL for vector similarity search with HNSW indexes?

Beginner LevelPostgreSQL

What is PostgreSQL architecture and how do client backends connect via process fork model?

Beginner LevelPostgreSQL

What special built-in data types exist in PostgreSQL (JSONB, UUID, ARRAY, INET, TEXT)?