Tag: PostgreSQL
Did PostgreSQL Win Because Oracle Screwed Up?

Original WeChat article On August 19, 2026, The Register published an interview with Michael Stonebraker. The Turing Award winner who started the Berkeley Postgres project—and is still founding companies in his eighties—was asked why PostgreSQL had …
Original WeChat article On August 19, 2026, The Register published an interview with Michael Stonebraker. The Turing Award winner who started the Berkeley Postgres project—and is still founding companies in his eighties—was asked why PostgreSQL had …
SOW: Postpartum Care for 100,000 Packages

Today, let’s talk about Postpartum Care for Sows—a Chinese meme for the sort of absurdly specialized practical topic nobody expects to discuss. This time, the sow in question is my new open-source project, SOW. When you maintain a PostgreSQL …
Today, let’s talk about Postpartum Care for Sows—a Chinese meme for the sort of absurdly specialized practical topic nobody expects to discuss. This time, the sow in question is my new open-source project, SOW. When you maintain a PostgreSQL …
Did AI Rewrite PostgreSQL in Rust? Not Quite

pgrust recently hit the front page of Hacker News. With AI, its author had ported PostgreSQL to Rust and passed the core regression suite. The obvious headline was: “AI rewrote PostgreSQL in Rust.” The repository tells a sharper story. A clean-room …
pgrust recently hit the front page of Hacker News. With AI, its author had ported PostgreSQL to Rust and passed the core regression suite. The obvious headline was: “AI rewrote PostgreSQL in Rust.” The repository tells a sharper story. A clean-room …
Happy 30th Birthday, PostgreSQL

Today, July 8, 2026, is PostgreSQL’s 30th birthday. Thirty years ago, Marc Fournier made a commit named “Postgres95 1.01 Distribution - Virgin Sources” into a newly created CVS repository. It was the first commit in the PostgreSQL codebase (d31084e), …
Today, July 8, 2026, is PostgreSQL’s 30th birthday. Thirty years ago, Marc Fournier made a commit named “Postgres95 1.01 Distribution - Virgin Sources” into a newly created CVS repository. It was the first commit in the PostgreSQL codebase (d31084e), …
Instantly Clone PostgreSQL Databases—No Black Magic Required

Six months ago, on January 8, 2026, I wrote Git for Data: Instant PostgreSQL Database and Instance Cloning, introducing a new feature in PostgreSQL 18 and Pigsty v4.0: instant database cloning. With filesystem copy-on-write (CoW) and PostgreSQL 18’s …
Six months ago, on January 8, 2026, I wrote Git for Data: Instant PostgreSQL Database and Instance Cloning, introducing a new feature in PostgreSQL 18 and Pigsty v4.0: instant database cloning. With filesystem copy-on-write (CoW) and PostgreSQL 18’s …
What Is a PostgreSQL Distribution?

People often ask me: what exactly is Pigsty? My usual answer is: a PostgreSQL distribution. The next question is usually: what, then, is a “PostgreSQL distribution”? That is a good question. And the best place to begin is not databases, but operating …
People often ask me: what exactly is Pigsty? My usual answer is: a PostgreSQL distribution. The next question is usually: what, then, is a “PostgreSQL distribution”? That is a good question. And the best place to begin is not databases, but operating …
Fifty Years of Love and War: File Systems, Databases, and the Agent-Era Storage Endgame

Prologue: Several Database People Independently Built File Systems Something curious has happened in agent infrastructure over the past six months: several veteran database people have started building “file systems for AI agents.” Timescale’s …
Prologue: Several Database People Independently Built File Systems Something curious has happened in agent infrastructure over the past six months: several veteran database people have started building “file systems for AI agents.” Timescale’s …
Extensions for Everyone

Slide deck: Extensions for Everyone Part I. Introduction 0. Extensions for Everyone 00. Extensions for Everyone Hi everyone. This talk is called Extensions for Everyone. It is about delivering PostgreSQL extensions, and about how a shared delivery …
Slide deck: Extensions for Everyone Part I. Introduction 0. Extensions for Everyone 00. Extensions for Everyone Hi everyone. This talk is called Extensions for Everyone. It is about delivering PostgreSQL extensions, and about how a shared delivery …
PGConf.Dev 2026 Opens Today in Vancouver

On May 19, Vancouver time, PGConf.Dev 2026 officially gets underway. This year’s venue is Simon Fraser University’s downtown campus, SFU Vancouver Harbour Centre. The conference has returned to Vancouver, host city of the inaugural PGConf.Dev. …
On May 19, Vancouver time, PGConf.Dev 2026 officially gets underway. This year’s venue is Simon Fraser University’s downtown campus, SFU Vancouver Harbour Centre. The conference has returned to Vancouver, host city of the inaugural PGConf.Dev. …
The pgBackRest Rescue and Open Source's Forced Price Discovery

A few days ago, pgBackRest, the PostgreSQL ecosystem’s leading open-source backup tool, was archived. Pigsty uses pgBackRest too, but I was not especially worried. A component this important was never going to be allowed to die for real—not by the …
A few days ago, pgBackRest, the PostgreSQL ecosystem’s leading open-source backup tool, was archived. Pigsty uses pgBackRest too, but I was not especially worried. A component this important was never going to be allowed to die for real—not by the …
pgBackRest is No Longer Maintained

On April 27, David Steele formally archived pgBackRest, the most important backup tool in the PostgreSQL ecosystem. The announcement appeared on GitHub and LinkedIn. It was brief and direct: The End-of-Maintenance Announcement TL;DR: pgBackRest is no …
On April 27, David Steele formally archived pgBackRest, the most important backup tool in the PostgreSQL ecosystem. The announcement appeared on GitHub and LinkedIn. It was brief and direct: The End-of-Maintenance Announcement TL;DR: pgBackRest is no …
Give DBA Agents a Body

HOW 2026 keynote: Give DBA Agents a Body Part I: Opening—An Absurd Phenomenon 1. Cover Hello, everyone. I’m Ruohang Feng, the organizer of this tools track. This is a PostgreSQL tools session, but today I don’t want to talk about how many new …
HOW 2026 keynote: Give DBA Agents a Body Part I: Opening—An Absurd Phenomenon 1. Cover Hello, everyone. I’m Ruohang Feng, the organizer of this tools track. This is a PostgreSQL tools session, but today I don’t want to talk about how many new …
MySQL 9.7: Same Old Leftovers, Reheated

Two years ago, I wrote MySQL Is Dead, Long Live PostgreSQL. MySQL 9.0 had just shipped, and Oracle had unveiled a VECTOR data type with great fanfare, billing it as “MySQL for the AI era.” One look was enough: it was a BLOB in a cheap disguise. No …
Two years ago, I wrote MySQL Is Dead, Long Live PostgreSQL. MySQL 9.0 had just shipped, and Oracle had unveiled a VECTOR data type with great fanfare, billing it as “MySQL for the AI era.” One look was enough: it was a BLOB in a cheap disguise. No …
The Three-Way Endgame: Why Agent Memory Frameworks Are a Dead End

A few months ago, I wrote The OS Moment for AI Agents. I made a prediction there: the next frenzy in agent infrastructure would be memory. Startups and open-source projects would swarm around the question of how agents should remember things. Capital …
A few months ago, I wrote The OS Moment for AI Agents. I made a prediction there: the next frenzy in agent infrastructure would be memory. Startups and open-source projects would swarm around the question of how agents should remember things. Capital …
504 Extensions: Expand the PostgreSQL Landscape

A GitHub issue turned into an extension sprint. 32 new additions say a lot about where PostgreSQL is headed. It Started with a Chemistry Extension Two days ago, a user opened a GitHub issue: he was using RDKit, the de facto standard library in …
A GitHub issue turned into an extension sprint. 32 new additions say a lot about where PostgreSQL is headed. It Started with a Chemistry Extension Two days ago, a user opened a GitHub issue: he was using RDKit, the de facto standard library in …
Why PostgreSQL Won in the AI Era

I recently did a recorded livestream on PostgreSQL and AI. The host asked a lot of good questions, and I gave some answers. The recording goes out Tuesday night. I am publishing the fuller written version of my views here, including quite a bit I did …
I recently did a recorded livestream on PostgreSQL and AI. The host asked a lot of good questions, and I gave some answers. The recording goes out Tuesday night. I am publishing the fuller written version of my views here, including quite a bit I did …
PostgreSQL vs. MySQL in 2026

PostgreSQL has won the market for new database deployments, and its installed base is now comparable to MySQL’s. With one rising and the other declining, there is little suspense left in the contest for the database kernel of the future. I. Developer …
PostgreSQL has won the market for new database deployments, and its installed base is now comparable to MySQL’s. With one rising and the other declining, there is little suspense left in the contest for the database kernel of the future. I. Developer …
Digoal, the Face of PostgreSQL at Alibaba Cloud, Has Left

Yesterday was April Fools’ Day, and Digoal published a post on his WeChat account titled “My Last Day as a Corporate Workhorse at Alibaba.” The database community immediately erupted. Many assumed it was an April Fools’ joke, but I knew it was not. …
Yesterday was April Fools’ Day, and Digoal published a post on his WeChat account titled “My Last Day as a Corporate Workhorse at Alibaba.” The database community immediately erupted. Many assumed it was an April Fools’ joke, but I knew it was not. …
Put Your AI Agent's State in a Database

A year ago, I wrote an article called PGFS: Using a Database as a Filesystem. It started with a request from the Odoo community: make files and the PostgreSQL database recoverable together with point-in-time recovery, so both could be rolled back to …
A year ago, I wrote an article called PGFS: Using a Database as a Filesystem. It started with a request from the Odoo community: make files and the PostgreSQL database recoverable together with point-in-time recovery, so both could be rolled back to …
InsForge: A Supabase Built for Vibe Coding

InsForge is one of the more interesting projects I have seen recently. Its pitch is simple: a Supabase-like backend stack designed specifically for AI coding agents. Apache 2.0 licensed, roughly 2,000 GitHub stars, built around PostgreSQL + PostgREST …
InsForge is one of the more interesting projects I have seen recently. Its pitch is simple: a Supabase-like backend stack designed specifically for AI coding agents. Apache 2.0 licensed, roughly 2,000 GitHub stars, built around PostgreSQL + PostgREST …
Is Oracle-Compatible Postgres Actually Useful?

I used to roll my eyes at “Oracle compatibility” in PostgreSQL forks. My take was simple: if your SQL doesn’t run on vanilla Postgres, fix your app rather than database. Then a migration task slightly changed my mind. The Problem: A JAR and Nothing …
I used to roll my eyes at “Oracle compatibility” in PostgreSQL forks. My take was simple: if your SQL doesn’t run on vanilla Postgres, fix your app rather than database. Then a migration task slightly changed my mind. The Problem: A JAR and Nothing …
Urgent Advisory: Pause PostgreSQL Minor-Release Installs and Upgrades

The 18.2 minor-release train introduced two bugs. Hold off on fresh deployments and upgrades, then update promptly after 18.3 ships next week. One week ago, the PostgreSQL community shipped its routine February minor releases, and Pigsty v4.1 …
The 18.2 minor-release train introduced two bugs. Hold off on fresh deployments and upgrades, then update promptly after 18.3 ships next week. One week ago, the PostgreSQL community shipped its routine February minor releases, and Pigsty v4.1 …
The Agent Moat: Runtime

3 AM. Database alerts are blowing up. You throw the alert info at a “top-tier” DBA Agent. It’s well-read — knows the PostgreSQL docs inside out, writes beautiful diagnostic SQL, can recite every kernel parameter from memory. It freezes: What’s the …
3 AM. Database alerts are blowing up. You throw the alert info at a “top-tier” DBA Agent. It’s well-read — knows the PostgreSQL docs inside out, writes beautiful diagnostic SQL, can recite every kernel parameter from memory. It freezes: What’s the …
The Great Software Meltdown: When Translation Layers Get Squashed

I. The Great Software Meltdown The software world is witnessing an epic valuation collapse. This isn’t about individual companies tanking. This is a systemic implosion of the entire SaaS sector. Wall Street is voting with real money: these software …
I. The Great Software Meltdown The software world is witnessing an epic valuation collapse. This isn’t about individual companies tanking. This is a systemic implosion of the entire SaaS sector. Wall Street is voting with real money: these software …
Agent OS: We're Building DOS Again

2025 is the year of the coding agent explosion. Claude Code writes your code, runs your tests, fixes your bugs, and autonomously completes complex engineering tasks. It’s the second seismic shift since ChatGPT dropped. But watch how these agents …
2025 is the year of the coding agent explosion. Claude Code writes your code, runs your tests, fixes your bugs, and autonomously completes complex engineering tasks. It’s the second seismic shift since ChatGPT dropped. But watch how these agents …
How to Actually Do PostgreSQL High Availability

Seven or eight years ago, I was managing a hundred large-scale PostgreSQL clusters across 200+ beefy bare-metal servers, and I started evaluating HA solutions. I went through every option with a name: Patroni, Corosync + Pacemaker, repmgr, Stolon, …
Seven or eight years ago, I was managing a hundred large-scale PostgreSQL clusters across 200+ beefy bare-metal servers, and I started evaluating HA solutions. I went through every option with a name: Patroni, Corosync + Pacemaker, repmgr, Stolon, …
Git for Data: Instant PostgreSQL Database Cloning

Every programmer has used git clone. Hit enter, wait a few seconds, and a complete code repository appears on your disk. But what about databases? Want a copy of production data for your test environment? The traditional approach is pg_dump + …
Every programmer has used git clone. Hit enter, wait a few seconds, and a complete code repository appears on your disk. But what about databases? Want a copy of production data for your test environment? The traditional approach is pg_dump + …
Data 2025: The year in review with Mike Stonebraker

Transcription of Data 2025: The year in review with Mike Stonebraker Data 2025: The Year in Review with Mike Stonebraker & Andy Pavlo Recorded on December 10, 2025 A conversation between Mike Stonebraker (MIT CSAIL, Turing Award Winner, Creator of …
Transcription of Data 2025: The year in review with Mike Stonebraker Data 2025: The Year in Review with Mike Stonebraker & Andy Pavlo Recorded on December 10, 2025 A conversation between Mike Stonebraker (MIT CSAIL, Turing Award Winner, Creator of …
What Kind of Database Do AI Agents Need?

When we talk about “databases for the AI era,” it is easy to fall into a familiar trap: assuming the shift requires a brand-new storage engine, a revolutionary index structure, or a disruptive query language. But a clear-eyed look at the problem …
When we talk about “databases for the AI era,” it is easy to fall into a familiar trap: assuming the shift requires a brand-new storage engine, a revolutionary index structure, or a disruptive query language. But a clear-eyed look at the problem …
Why PostgreSQL Will Dominate the AI Era

In the Agent era, the underlying logic of software architecture has changed. Over the past decade, we’ve built microservices and “polyglot persistence” to accommodate the collaboration boundaries of human teams, fragmenting our systems into scattered …
In the Agent era, the underlying logic of software architecture has changed. Over the past decade, we’ve built microservices and “polyglot persistence” to accommodate the collaboration boundaries of human teams, fragmenting our systems into scattered …
Forging a China-Rooted, Global PostgreSQL Distro

Hi, I’m Feng Ruohang, author of Pigsty and an independent open-source contributor. Let’s talk about how to build a PostgreSQL distribution that is rooted in China and useful to the whole world. The question isn’t whether PG will win—it already has. …
Hi, I’m Feng Ruohang, author of Pigsty and an independent open-source contributor. Let’s talk about how to build a PostgreSQL distribution that is rooted in China and useful to the whole world. The question isn’t whether PG will win—it already has. …
Don't Run Docker Postgres for Production!

Back in 2019, I wrote about “Is running postgres in docker a good idea?” — Don’t run PostgreSQL in containers for production, because you’ll likely hit a pile of issues that simply don’t exist on bare metal or VMs. Well, users of Docker’s “official” …
Back in 2019, I wrote about “Is running postgres in docker a good idea?” — Don’t run PostgreSQL in containers for production, because you’ll likely hit a pile of issues that simply don’t exist on bare metal or VMs. Well, users of Docker’s “official” …
PG Extension Cloud: Unlocking PostgreSQL’s Entire Ecosystem

WeChat link PostgreSQL’s killer feature is extensibility. PostGIS, pgvector, pg_duckdb, pg_search—extensions turn PG into GIS engine, vector DB, analytics warehouse, search cluster. But compiling and shipping them reliably across distros is a …
WeChat link PostgreSQL’s killer feature is extensibility. PostGIS, pgvector, pg_duckdb, pg_search—extensions turn PG into GIS engine, vector DB, analytics warehouse, search cluster. But compiling and shipping them reliably across distros is a …
The PostgreSQL 'Supply Cut' and Trust Issues in Software Supply Chain

This month saw a high-profile “open source supply cut” incident — KubeSphere deleting images and running away, but there’s another slightly more subtle “chokepoint case” I mentioned last month — “Chokepoint: PGDG Cuts Mirror Sync Channels”. This …
This month saw a high-profile “open source supply cut” incident — KubeSphere deleting images and running away, but there’s another slightly more subtle “chokepoint case” I mentioned last month — “Chokepoint: PGDG Cuts Mirror Sync Channels”. This …
Column: Postgres Mage

Ecosystem PGEXT.DAY 2025, See You There OrioleDB Is Coming! OpenHalo: MySQL-Compatible PG PGFS: Database as Filesystem PostgreSQL Ecosystem Frontier Progress Pig on Elephant: PG Package Manager Pig Release Day Halt: PG Also Can’t Escape Major …
Ecosystem PGEXT.DAY 2025, See You There OrioleDB Is Coming! OpenHalo: MySQL-Compatible PG PGFS: Database as Filesystem PostgreSQL Ecosystem Frontier Progress Pig on Elephant: PG Package Manager Pig Release Day Halt: PG Also Can’t Escape Major …
PostgreSQL Dominates Database World, but Who Will Devour PG?

Percona is a banner-bearer and major third-party vendor in the MySQL ecosystem, and has been advancing into the PostgreSQL space in recent years. The English original of this article was published on the Percona blog this morning. Of course, Percona …
Percona is a banner-bearer and major third-party vendor in the MySQL ecosystem, and has been advancing into the PostgreSQL space in recent years. The English original of this article was published on the Percona blog this morning. Of course, Percona …
PostgreSQL Has Dominated the Database World

The 2025 StackOverflow Global Developer Survey results are fresh out, with high-quality questionnaire feedback from 50,000 developers across 177 countries and regions. As a database veteran, I’m most interested in the “Database” section of this …
The 2025 StackOverflow Global Developer Survey results are fresh out, with high-quality questionnaire feedback from 50,000 developers across 177 countries and regions. As a database veteran, I’m most interested in the “Database” section of this …
Dongchedi Just Exposed “Smart Driving.” Where’s Our Dongku-Di?

I rented a car today, drove from Shanghai back to Ningbo. Yesterday I watched Dongchedi’s autonomous-driving showdown—closed highway + real city roads + 30+ “smart driving” models. Everyone faceplanted except Tesla. The episode aired and every Tesla …
I rented a car today, drove from Shanghai back to Ningbo. Yesterday I watched Dongchedi’s autonomous-driving showdown—closed highway + real city roads + 30+ “smart driving” models. Everyone faceplanted except Tesla. The episode aired and every Tesla …
Google AI Toolbox: Production-Ready Database MCP is Here?

In “SaaS is Dead? In the AI Era, Software Starts with Databases”, Microsoft CEO Nadella once stated that in the Agent era, SaaS is Dead, and the future form of software will be Agent + Database. That is, Agents directly performing CRUD operations on …
In “SaaS is Dead? In the AI Era, Software Starts with Databases”, Microsoft CEO Nadella once stated that in the Agent era, SaaS is Dead, and the future form of software will be Agent + Database. That is, Agents directly performing CRUD operations on …
PGDG Cuts Off Mirror Sync Channel

Recently, while building Pigsty offline packages, I discovered that the PostgreSQL version installed during local testing wasn’t quite right - 17.4 was behind the latest 17.5 by one minor version. Also, when testing on EL10, I found several …
Recently, while building Pigsty offline packages, I discovered that the PostgreSQL version installed during local testing wasn’t quite right - 17.4 was behind the latest 17.5 by one minor version. Also, when testing on EL10, I found several …
Stop Arguing, The AI Era Database Has Been Settled

This morning, the industry exploded with news of an acquisition. Following Databricks’ $1 billion acquisition of Neon, its rival Snowflake immediately followed by acquiring CrunchyData. According to insiders, this deal was priced at $250 million. …
This morning, the industry exploded with news of an acquisition. Following Databricks’ $1 billion acquisition of Neon, its rival Snowflake immediately followed by acquiring CrunchyData. According to insiders, this deal was priced at $250 million. …
Scaling Postgres to the next level at OpenAI

At PGConf.Dev 2025, Bohan Zhang from OpenAI shared a session titled Scaling Postgres to the next level at OpenAI, giving us a peek into the database usage of a top-tier unicorn. “At OpenAl, we’ve proven that PostgreSQL can scale to support massive …
At PGConf.Dev 2025, Bohan Zhang from OpenAI shared a session titled Scaling Postgres to the next level at OpenAI, giving us a peek into the database usage of a top-tier unicorn. “At OpenAl, we’ve proven that PostgreSQL can scale to support massive …
In the AI Era, Software Starts at the Database

WeChat The future stack is “Agent + Database.” No front-end/back-end toll booths—agents talk CRUD straight to storage. Database skills hold their value, and PostgreSQL is the database of the agent era. SaaS is dead? Software begins with the DB GenAI …
WeChat The future stack is “Agent + Database.” No front-end/back-end toll booths—agents talk CRUD straight to storage. Database skills hold their value, and PostgreSQL is the database of the agent era. SaaS is dead? Software begins with the DB GenAI …
MySQL vs. PostgreSQL @ 2025

In 2025, PostgreSQL has opened a clear lead over MySQL on features, correctness, performance, and ecosystem—and the gap keeps widening. Here’s the panoramic view. Features Release cadence MySQL just dropped “Innovation” 9.3 (release notes), yet the …
In 2025, PostgreSQL has opened a clear lead over MySQL on features, correctness, performance, and ecosystem—and the gap keeps widening. Here’s the panoramic view. Features Release cadence MySQL just dropped “Innovation” 9.3 (release notes), yet the …
Postgres Extension Day - See You There!

The annual PostgreSQL developer conference will be held in Montreal in May. Like the first PG Con.Dev, there’s also an additional dedicated event - Postgres Extensions Day, focusing on all aspects of PG extension development, delivery, and release. …
The annual PostgreSQL developer conference will be held in Montreal in May. Like the first PG Con.Dev, there’s also an additional dedicated event - Postgres Extensions Day, focusing on all aspects of PG extension development, delivery, and release. …
OrioleDB is Coming! 4x Performance, Eliminates Pain Points, Storage-Compute Separation

OrioleDB, which sounds interesting - though “Oriole” means a type of bird (黄鹂 in Chinese), so it should actually be translated as “Oriole Database” rather than “Cookie Database” or “Bird Database”. The name doesn’t matter much; what’s important is …
OrioleDB, which sounds interesting - though “Oriole” means a type of bird (黄鹂 in Chinese), so it should actually be translated as “Oriole Database” rather than “Cookie Database” or “Bird Database”. The name doesn’t matter much; what’s important is …
OpenHalo: MySQL Wire-Compatible PostgreSQL is Here!

What? PostgreSQL can now be accessed using MySQL clients? That’s right, openHalo, which was open-sourced on April Fool’s Day, provides exactly this capability — allowing users to simultaneously access and manage the same database using both MySQL and …
What? PostgreSQL can now be accessed using MySQL clients? That’s right, openHalo, which was open-sourced on April Fool’s Day, provides exactly this capability — allowing users to simultaneously access and manage the same database using both MySQL and …
PGFS: Using Database as a Filesystem

A few days ago, I received a request from the Odoo community asking: “Databases support PITR (Point-in-Time Recovery), but is there a way to roll back the filesystem as well?” Why the “PGFS” Idea? From a veteran database engineer’s perspective, this …
A few days ago, I received a request from the Odoo community asking: “Databases support PITR (Point-in-Time Recovery), but is there a way to roll back the filesystem as well?” Why the “PGFS” Idea? From a veteran database engineer’s perspective, this …
Database Planet Collision: When PG Falls for DuckDB

When I published “PostgreSQL Is Eating the Database World” last year, I tossed out this wild idea: Could Postgres really unify OLTP and OLAP? I had no clue we’d see fireworks so quickly. The PG community’s now in an all-out frenzy to stitch DuckDB …
When I published “PostgreSQL Is Eating the Database World” last year, I tossed out this wild idea: Could Postgres really unify OLTP and OLAP? I had no clue we’d see fireworks so quickly. The PG community’s now in an all-out frenzy to stitch DuckDB …
Alicloud’s rds_duckdb: Tribute or Rip-Off?

A viral post titled “Heavenly ‘PostgreSQL’ Calls Earthly Postgres ‘Little Trash’” hyped up Alicloud RDS’s new rds_duckdb plugin for OLAP and declared that managed RDS PG is noble while open-source Postgres is garbage. That take is ridiculous. I know …
A viral post titled “Heavenly ‘PostgreSQL’ Calls Earthly Postgres ‘Little Trash’” hyped up Alicloud RDS’s new rds_duckdb plugin for OLAP and declared that managed RDS PG is noble while open-source Postgres is garbage. That take is ridiculous. I know …
Comparing Oracle and PostgreSQL Transaction Systems

Original by Laurenz Albe. Translation and commentary by Feng Ruohang. Transactions sit at the heart of relational databases. They guarantee data integrity for applications. SQL defines some transactional behavior but leaves plenty unspecified, so …
Original by Laurenz Albe. Translation and commentary by Feng Ruohang. Transactions sit at the heart of relational databases. They guarantee data integrity for applications. SQL defines some transactional behavior but leaves plenty unspecified, so …
PostgreSQL Ecosystem Frontier Developments

Dear readers, I’m starting my vacation today. I might stop posting for two weeks, so Happy New Year in advance. Of course, before starting vacation, this article shares some interesting recent developments in the PG ecosystem. Yesterday I also …
Dear readers, I’m starting my vacation today. I might stop posting for two weeks, so Happy New Year in advance. Of course, before starting vacation, this article shares some interesting recent developments in the PG ecosystem. Yesterday I also …
Database as Business Architecture

Databases are the core of business architecture - this is self-evident consensus. But what if we go further and treat databases as business architecture itself, putting business logic, web servers, and even entire front and back ends into databases? …
Databases are the core of business architecture - this is self-evident consensus. But what if we go further and treat databases as business architecture itself, putting business logic, web servers, and even entire front and back ends into databases? …
Pig, The Postgres Extension Wizard

Title: Meet Pig: The Postgres Extension Wizard Ever wished installing or upgrading PostgreSQL extensions didn’t feel like digging through outdated readmes, cryptic configure scripts, or random GitHub forks & patches? The painful truth is that …
Title: Meet Pig: The Postgres Extension Wizard Ever wished installing or upgrading PostgreSQL extensions didn’t feel like digging through outdated readmes, cryptic configure scripts, or random GitHub forks & patches? The painful truth is that …
Solving the 24-Point Card Game with a Single SQL Query

Here is the challenge: Database Programming Contest: Solve the 24-Point Card Game with One SQL Query, hosted by the database tooling platform NineData. There is a table named cards. Its auto-incrementing numeric primary key is id, and it has 4 …
Here is the challenge: Database Programming Contest: Solve the 24-Point Card Game with One SQL Query, hosted by the database tooling platform NineData. There is a table named cards. Its auto-incrementing numeric primary key is id, and it has 4 …
7 Databases in 7 Weeks (2025)

Author: Matt Blewitt, Original: 7 Databases in 7 Weeks (2025) Translator: Feng Ruohang, database veteran, cloud computing mudslide https://matt.blwt.io/post/7-databases-in-7-weeks-for-2025/ For a long time, I’ve been running Databases-as-a-Service, …
Author: Matt Blewitt, Original: 7 Databases in 7 Weeks (2025) Translator: Feng Ruohang, database veteran, cloud computing mudslide https://matt.blwt.io/post/7-databases-in-7-weeks-for-2025/ For a long time, I’ve been running Databases-as-a-Service, …
Don't Upgrade! Released and Immediately Pulled - Even PostgreSQL Isn't Immune to Epic Fails

The old saying goes: never deploy code on Friday. The PostgreSQL minor releases issued two days ago deliberately avoided Friday deployment, but still gave the community a week’s worth of extra work — the PostgreSQL community will release an unusual …
The old saying goes: never deploy code on Friday. The PostgreSQL minor releases issued two days ago deliberately avoided Friday deployment, but still gave the community a week’s worth of extra work — the PostgreSQL community will release an unusual …
PostgreSQL 12 End-of-Life, PG 17 Takes the Throne

According to PostgreSQL’s versioning policy, PostgreSQL 12, released in 2019, will officially exit its support lifecycle today (2024-11-14). PG 12’s final minor version is 12.21, released on 2024-11-14, and this will be PG 12’s ultimate version. …
According to PostgreSQL’s versioning policy, PostgreSQL 12, released in 2019, will officially exit its support lifecycle today (2024-11-14). PG 12’s final minor version is 12.21, released on 2024-11-14, and this will be PG 12’s ultimate version. …
The Ideal Way to Deliver PostgreSQL Extensions

PostgreSQL Is Eating the Database World through the power of extensibility. When this post was first published, the repository packaged 390 PostgreSQL extensions as RPM / DEB packages for mainstream Linux distributions. The live Pigsty Extension …
PostgreSQL Is Eating the Database World through the power of extensibility. When this post was first published, the repository packaged 390 PostgreSQL extensions as RPM / DEB packages for mainstream Linux distributions. The live Pigsty Extension …
PostgreSQL 17 Released: No More Pretending!

The annual PostgreSQL major version release is here! What surprises does PostgreSQL 17 bring us this time? In this major version release announcement, the PostgreSQL global community has finally come clean — Sorry, no more pretending — “PostgreSQL is …
The annual PostgreSQL major version release is here! What surprises does PostgreSQL 17 bring us this time? In this major version release announcement, the PostgreSQL global community has finally come clean — Sorry, no more pretending — “PostgreSQL is …
MongoDB Has No Future: Good Marketing Can't Save a Rotten Mango

These past few days, MongoDB’s marketing stunts have been dazzling: “MongoDB Declares War on PostgreSQL”, “MongoDB Defeats PostgreSQL to Win $30 Billion Project”, and the original article from The Register “MongoDB Prepares to Pummel PostgreSQL After …
These past few days, MongoDB’s marketing stunts have been dazzling: “MongoDB Declares War on PostgreSQL”, “MongoDB Defeats PostgreSQL to Win $30 Billion Project”, and the original article from The Register “MongoDB Prepares to Pummel PostgreSQL After …
MongoDB: Now Powered by PostgreSQL?

Preface Tomorrow I’ll publish an article criticizing MongoDB, as a response to their recent malicious marketing that provocatively targets PostgreSQL. But before that, I want to share a brilliant article from 2015 that exposes some of MongoDB’s dark …
Preface Tomorrow I’ll publish an article criticizing MongoDB, as a response to their recent malicious marketing that provocatively targets PostgreSQL. But before that, I want to share a brilliant article from 2015 that exposes some of MongoDB’s dark …
Can PostgreSQL Replace Microsoft SQL Server?

Many people don’t have an intuitive impression of how far PostgreSQL’s ecosystem has developed. Beyond devouring the database world and its all-encompassing extension ecosystem, PostgreSQL can directly replace Oracle, SQL Server, and MongoDB at the …
Many people don’t have an intuitive impression of how far PostgreSQL’s ecosystem has developed. Beyond devouring the database world and its all-encompassing extension ecosystem, PostgreSQL can directly replace Oracle, SQL Server, and MongoDB at the …
Whoever Integrates DuckDB Best Wins the OLAP World

In my article “[PostgreSQL is Eating the Database World],” I posed this question: Who will ultimately unify the database world? I believe it’s the PostgreSQL ecosystem with various extensions — and my judgment is that to conquer OLAP, the largest and …
In my article “[PostgreSQL is Eating the Database World],” I posed this question: Who will ultimately unify the database world? I believe it’s the PostgreSQL ecosystem with various extensions — and my judgment is that to conquer OLAP, the largest and …
StackOverflow 2024 Survey: PostgreSQL Has Gone Completely Berserk

The 2024 StackOverflow Global Developer Survey results are fresh out, with high-quality questionnaire feedback from 60,000 developers across 185 countries and regions. Of course, as a database veteran, I’m most interested in the “Database” section of …
The 2024 StackOverflow Global Developer Survey results are fresh out, with high-quality questionnaire feedback from 60,000 developers across 185 countries and regions. Of course, as a database veteran, I’m most interested in the “Database” section of …
Self-Hosting Dify with PG, PGVector, and Pigsty

Dify – The Innovation Engine for GenAI Applications Dify is an open-source LLM app development platform. Orchestrate LLM apps from agents to complex AI workflows, with an RAG engine. Which claims to be more production-ready than LangChain. Of course, …
Dify – The Innovation Engine for GenAI Applications Dify is an open-source LLM app development platform. Orchestrate LLM apps from agents to complex AI workflows, with an RAG engine. Which claims to be more production-ready than LangChain. Of course, …
PGCon.Dev 2024, The conf that shutdown PG for a week

PGCon.Dev, once known as PGCon—the annual must-attend gathering for PostgreSQL hackers and key forum for its future direction, has been held in Ottawa since its inception in 2007. This year marks a new chapter as the original organizer, Dan, hands …
PGCon.Dev, once known as PGCon—the annual must-attend gathering for PostgreSQL hackers and key forum for its future direction, has been held in Ottawa since its inception in 2007. This year marks a new chapter as the original organizer, Dan, hands …
PostgreSQL 17 Beta1 Released!

The PostgreSQL Global Development Group announces that PostgreSQL 17’s first Beta version is now available for download. This version includes a preview of all features that will be available when PostgreSQL 17 is officially released, though some …
The PostgreSQL Global Development Group announces that PostgreSQL 17’s first Beta version is now available for download. This version includes a preview of all features that will be available when PostgreSQL 17 is officially released, though some …
Postgres is eating the database world

PostgreSQL isn’t just a simple relational database; it’s a data management framework with the potential to engulf the entire database realm. The trend of “Using Postgres for Everything” is no longer limited to a few elite teams but is becoming a …
PostgreSQL isn’t just a simple relational database; it’s a data management framework with the potential to engulf the entire database realm. The trend of “Using Postgres for Everything” is no longer limited to a few elite teams but is becoming a …
Technical Minimalism: Just Use PostgreSQL for Everything

This article was published by Stephan Schmidt @ KingOfCoders on Hacker News and sparked heated discussion: Using PostgreSQL to replace Kafka, RabbitMQ, ElasticSearch, MongoDB, and Redis is a viable approach that can dramatically reduce system …
This article was published by Stephan Schmidt @ KingOfCoders on Hacker News and sparked heated discussion: Using PostgreSQL to replace Kafka, RabbitMQ, ElasticSearch, MongoDB, and Redis is a viable approach that can dramatically reduce system …
New PostgreSQL Ecosystem Player: ParadeDB

Original WeChat Article Link New PostgreSQL Ecosystem Player: ParadeDB YC S23 invested in a new project called ParadeDB, which is extremely interesting. Their slogan is “Postgres for Search & Analytics — Modern Elasticsearch Alternative built on …
Original WeChat Article Link New PostgreSQL Ecosystem Player: ParadeDB YC S23 invested in a new project called ParadeDB, which is extremely interesting. Their slogan is “Postgres for Search & Analytics — Modern Elasticsearch Alternative built on …
PostgreSQL's Impressive Scalability

Source: How Cloudflare Supports 55M QPS with 15 PostgreSQL Clusters In July 2009, in California, USA, a startup team created a Content Delivery Network (CDN) called Cloudflare to accelerate internet requests, making network access more stable and …
Source: How Cloudflare Supports 55M QPS with 15 PostgreSQL Clusters In July 2009, in California, USA, a startup team created a Content Delivery Network (CDN) called Cloudflare to accelerate internet requests, making network access more stable and …
PostgreSQL Wins 2024 Database of the Year Award! (Fifth Time)

Today, the famous database popularity ranking DB-Engine announced the 2024 Database of the Year. PostgreSQL has won this honor for the fifth time. Of course, PostgreSQL was also the Database of the Year in 2023, 2019, 2018, and 2017. If Snowflake …
Today, the famous database popularity ranking DB-Engine announced the 2024 Database of the Year. PostgreSQL has won this honor for the fifth time. Of course, PostgreSQL was also the Database of the Year in 2023, 2019, 2018, and 2017. If Snowflake …
PostgreSQL Convention 2024

Background 0x01 Naming Convention 0x01 Design Convention 0x01 Query Convention 0x01 Admin Convention Roughly translated from PostgreSQL Convention 2024 with Google. 0x00 Background No Rules, No Lines The functions of PostgreSQL are very powerful, …
Background 0x01 Naming Convention 0x01 Design Convention 0x01 Query Convention 0x01 Admin Convention Roughly translated from PostgreSQL Convention 2024 with Google. 0x00 Background No Rules, No Lines The functions of PostgreSQL are very powerful, …
PostgreSQL Macro Query Optimization with pg_stat_statements

In production online databases, slow queries not only affect end-user experience but also waste system resources, increase resource saturation, cause deadlocks and transaction conflicts, increase database connection pressure, and lead to master-slave …
In production online databases, slow queries not only affect end-user experience but also waste system resources, increase resource saturation, cause deadlocks and transaction conflicts, increase database connection pressure, and lead to master-slave …
FerretDB: PostgreSQL Disguised as MongoDB

MongoDB was once an amazing technology that allowed developers to break free from relational database “schema constraints” and quickly build applications. However, over time, MongoDB abandoned its open-source nature, making it unavailable for many …
MongoDB was once an amazing technology that allowed developers to break free from relational database “schema constraints” and quickly build applications. However, over time, MongoDB abandoned its open-source nature, making it unavailable for many …
How to Use pg_filedump for Data Recovery?

Backups are a DBA’s lifeline — but what if your PostgreSQL database has already exploded and you have no backups? Maybe pg_filedump can help you! Recently encountered a rather outrageous case. The situation was this: a user’s PostgreSQL database was …
Backups are a DBA’s lifeline — but what if your PostgreSQL database has already exploded and you have no backups? Maybe pg_filedump can help you! Recently encountered a rather outrageous case. The situation was this: a user’s PostgreSQL database was …
PostgreSQL, The most successful database

The StackOverflow 2023 Survey, featuring feedback from 90K developers across 185 countries, is out. PostgreSQL topped all three survey categories (used, loved, and wanted), earning its title as the undisputed “Decathlete Database” – it’s hailed as …
The StackOverflow 2023 Survey, featuring feedback from 90K developers across 185 countries, is out. PostgreSQL topped all three survey categories (used, loved, and wanted), earning its title as the undisputed “Decathlete Database” – it’s hailed as …
AI Large Models and Vector Database PGVector

New AI applications have shown exponential growth over the past year, and these applications face a common challenge: how to store and query AI embeddings represented as vectors at scale. This article focuses on vector databases hyped by AI, …
New AI applications have shown exponential growth over the past year, and these applications face a common challenge: how to store and query AI embeddings represented as vectors at scale. This article focuses on vector databases hyped by AI, …
How Powerful is PostgreSQL Really?

Previously, we analyzed StackOverflow survey data to explain “Why PostgreSQL is the Most Successful Database”. This time we’ll let performance data speak for itself, discussing just how powerful the most successful PostgreSQL really is, helping you …
Previously, we analyzed StackOverflow survey data to explain “Why PostgreSQL is the Most Successful Database”. This time we’ll let performance data speak for itself, discussing just how powerful the most successful PostgreSQL really is, helping you …
Why PostgreSQL is the Most Successful Database?

When we say a database is “successful,” what exactly do we mean? Is it about features, performance, usability, or cost, ecosystem, complexity? There are many metrics, but ultimately users decide. Database users are developers, so what about …
When we say a database is “successful,” what exactly do we mean? Is it about features, performance, usability, or cost, ecosystem, complexity? There are many metrics, but ultimately users decide. Database users are developers, so what about …
Ready-to-Use PostgreSQL Distribution: Pigsty

What is Pigsty Pigsty is a ready-to-use production-grade open-source PostgreSQL distribution. A distribution refers to a complete database solution consisting of a database kernel and its suite of software packages. For example, Linux is an operating …
What is Pigsty Pigsty is a ready-to-use production-grade open-source PostgreSQL distribution. A distribution refers to a complete database solution consisting of a database kernel and its suite of software packages. For example, Linux is an operating …
Why Does PostgreSQL Have a Bright Future?

Recently, everything I’ve been working on revolves around the PostgreSQL ecosystem, because I’ve always felt this is a direction with unlimited potential. Why do I say this? Because databases are the core component of information systems, relational …
Recently, everything I’ve been working on revolves around the PostgreSQL ecosystem, because I’ve always felt this is a direction with unlimited potential. Why do I say this? Because databases are the core component of information systems, relational …
Localization and Collation Rules in PostgreSQL

Why does Pigsty default to locale=C and encoding=UTF8 when initializing PostgreSQL databases? The answer is simple: Unless you explicitly know you need LOCALE-related functionality, you should never configure anything other than C.UTF8 for character …
Why does Pigsty default to locale=C and encoding=UTF8 when initializing PostgreSQL databases? The answer is simple: Unless you explicitly know you need LOCALE-related functionality, you should never configure anything other than C.UTF8 for character …
Implementing Advanced Fuzzy Search

In daily development, we often encounter requirements for fuzzy search. Today, let’s briefly discuss how to implement some advanced fuzzy search using PostgreSQL. Of course, the fuzzy search I’m talking about here isn’t the old-fashioned LIKE …
In daily development, we often encounter requirements for fuzzy search. Today, let’s briefly discuss how to implement some advanced fuzzy search using PostgreSQL. Of course, the fuzzy search I’m talking about here isn’t the old-fashioned LIKE …
PostgreSQL Logical Replication Deep Dive

Logical Replication Logical Replication is a method of replicating data objects and their changes based on their replica identity (usually the primary key). The term logical replication contrasts with physical replication. Physical replication uses …
Logical Replication Logical Replication is a method of replicating data objects and their changes based on their replica identity (usually the primary key). The term logical replication contrasts with physical replication. Physical replication uses …
PG Replica Identity Explained

Introduction: DIY Logical Replication The concept of replica identity serves logical replication. The basic working principle of logical replication is to decode row-level INSERT/UPDATE/DELETE events from logical publication-related tables and …
Introduction: DIY Logical Replication The concept of replica identity serves logical replication. The basic working principle of logical replication is to decode row-level INSERT/UPDATE/DELETE events from logical publication-related tables and …
A Methodology for Diagnosing PostgreSQL Slow Queries

“You can’t optimize what you can’t measure.” Slow queries hog connections, hold locks, block replication, trigger deadlocks, and waste resources. Every DBA must know how to find and fix them quickly. Traditional tools pg_stat_statements – essential …
“You can’t optimize what you can’t measure.” Slow queries hog connections, hold locks, block replication, trigger deadlocks, and waste resources. Every DBA must know how to find and fix them quickly. Traditional tools pg_stat_statements – essential …
Incident-Report: Patroni Failure Due to Time Travel

Summary: Machine restarted due to failure, NTP service corrected PG time after PG startup, causing Patroni to fail to start. The failure information in Patroni is shown as follows: Process %s is not postmaster, too much difference between PID file …
Summary: Machine restarted due to failure, NTP service corrected PG time after PG startup, causing Patroni to fail to start. The failure information in Patroni is shown as follows: Process %s is not postmaster, too much difference between PID file …
Online Primary Key Column Type Change

Author: Vonng (@Vonng) How to change primary key column types online, such as upgrading from INT to BIGINT, without affecting business operations? Suppose you have a table in PostgreSQL where you initially chose an INT primary key without much …
Author: Vonng (@Vonng) How to change primary key column types online, such as upgrading from INT to BIGINT, without affecting business operations? Suppose you have a table in PostgreSQL where you initially chose an INT primary key without much …
Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation

Preface Playing with databases and playing with cars have something in common - they both require frequently checking the dashboard. What are you doing staring at the dashboard? Looking at metrics. Why look at metrics? You need to understand the …
Preface Playing with databases and playing with cars have something in common - they both require frequently checking the dashboard. What are you doing staring at the dashboard? Looking at metrics. Why look at metrics? You need to understand the …
Database Cluster Management Concepts and Entity Naming Conventions

Author: Vonng (@Vonng) “Once named, it can be spoken; once spoken, it can be acted upon.” Concepts and their naming are very important. Naming style reflects an engineer’s understanding of system architecture. Poorly defined concepts lead to …
Author: Vonng (@Vonng) “Once named, it can be spoken; once spoken, it can be acted upon.” Concepts and their naming are very important. Naming style reflects an engineer’s understanding of system architecture. Poorly defined concepts lead to …
PostgreSQL's KPI

Managing databases is similar to managing people - both need KPIs (Key Performance Indicators). So what are database KPIs? This article introduces a way to measure PostgreSQL load: using a single horizontally comparable metric that is basically …
Managing databases is similar to managing people - both need KPIs (Key Performance Indicators). So what are database KPIs? This article introduces a way to measure PostgreSQL load: using a single horizontally comparable metric that is basically …
Online PostgreSQL Column Type Migration

Scenario In the lifecycle of a database, there’s a common type of requirement: modifying column types. For example: Using INT as a primary key, only to discover that business is booming and the 2.1 billion limit of INT32 isn’t enough, wanting to …
Scenario In the lifecycle of a database, there’s a common type of requirement: modifying column types. For example: Using INT as a primary key, only to discover that business is booming and the 2.1 billion limit of INT32 isn’t enough, wanting to …
Transaction Isolation Level Considerations

PostgreSQL actually has only two transaction isolation levels: Read Committed and Serializable Basics The SQL standard defines four isolation levels, but PostgreSQL actually has only two transaction isolation levels: Read Committed and Serializable …
PostgreSQL actually has only two transaction isolation levels: Read Committed and Serializable Basics The SQL standard defines four isolation levels, but PostgreSQL actually has only two transaction isolation levels: Read Committed and Serializable …
Frontend-Backend Communication Wire Protocol

Understanding the TCP protocol used for communication between PostgreSQL server and client Startup Phase The basic flow of the startup phase is as follows: Client sends a StartupMessage (F) to initiate connection request to server Payload includes …
Understanding the TCP protocol used for communication between PostgreSQL server and client Startup Phase The basic flow of the startup phase is as follows: Client sends a StartupMessage (F) to initiate connection request to server Payload includes …
Incident: PostgreSQL Extension Installation Causes Connection Failure

Author: Vonng (@Vonng) Today encountered an interesting case where a customer reported database connection issues. The error was: psql: FATAL: could not load library "/export/servers/pgsql/lib/pg_hint_plan.so": …
Author: Vonng (@Vonng) Today encountered an interesting case where a customer reported database connection issues. The error was: psql: FATAL: could not load library "/export/servers/pgsql/lib/pg_hint_plan.so": …
CDC Change Data Capture Mechanisms

In actual production, we often need to synchronize database states to other places, such as synchronizing to data warehouses for analysis, to message queues for downstream consumption, or to caches to accelerate queries. Generally speaking, there are …
In actual production, we often need to synchronize database states to other places, such as synchronizing to data warehouses for analysis, to message queues for downstream consumption, or to caches to accelerate queries. Generally speaking, there are …
Locks in PostgreSQL

PostgreSQL relies on snapshot isolation (SI) for concurrency and two-phase locking (2PL) as a supporting act. DML (SELECT/INSERT/UPDATE/DELETE) uses SSI; DDL (CREATE TABLE etc.) still uses 2PL. Understanding locks is essential when diagnosing …
PostgreSQL relies on snapshot isolation (SI) for concurrency and two-phase locking (2PL) as a supporting act. DML (SELECT/INSERT/UPDATE/DELETE) uses SSI; DDL (CREATE TABLE etc.) still uses 2PL. Understanding locks is essential when diagnosing …
O(n2) Complexity of GIN Search

When GIN indexes are used to search with very long keyword lists, performance degrades significantly. This article explains why GIN index keyword search has O(n^2) time complexity. Here is the detail of why that query have O(N^2) inside GIN …
When GIN indexes are used to search with very long keyword lists, performance degrades significantly. This article explains why GIN index keyword search has O(n^2) time complexity. Here is the detail of why that query have O(N^2) inside GIN …
PostgreSQL Common Replication Topology Plans

Replication is one of the core issues in system architecture. Cluster Topology Suppose we use a standard 4-unit configuration: primary, synchronous replica, delayed backup, and remote replica, identified by letters M, S, O, R respectively. M: Master, …
Replication is one of the core issues in system architecture. Cluster Topology Suppose we use a standard 4-unit configuration: primary, synchronous replica, delayed backup, and remote replica, identified by letters M, S, O, R respectively. M: Master, …
Warm Standby: Using pg_receivewal

Author: Vonng (@Vonng) Backup is the foundation of a DBA’s livelihood and one of the most critical tasks in database management. There are various types of backups, but the backups discussed here are all physical backups. Physical backups can …
Author: Vonng (@Vonng) Backup is the foundation of a DBA’s livelihood and one of the most critical tasks in database management. There are various types of backups, but the backups discussed here are all physical backups. Physical backups can …
Incident-Report: Connection-Pool Contamination Caused by pg_dump

PostgreSQL is great, but that doesn’t mean it’s Bug-Free. This time in the production environment, I encountered another very interesting case: a production incident caused by pg_dump. This is a very subtle bug triggered by Pgbouncer, search_path, …
PostgreSQL is great, but that doesn’t mean it’s Bug-Free. This time in the production environment, I encountered another very interesting case: a production incident caused by pg_dump. This is a very subtle bug triggered by Pgbouncer, search_path, …
PostgreSQL Data Page Corruption Repair

PostgreSQL is a very reliable database, but even the most reliable database will struggle when faced with unreliable hardware. This article introduces methods for dealing with data page corruption in PostgreSQL. The Initial Problem A statistics …
PostgreSQL is a very reliable database, but even the most reliable database will struggle when faced with unreliable hardware. This article introduces methods for dealing with data page corruption in PostgreSQL. The Initial Problem A statistics …
Relation Bloat Monitoring and Management

Author: Vonng (@Vonng) PostgreSQL uses MVCC as its primary concurrency control technology. While it has many benefits, it also brings other effects, such as relation bloat. Relation bloat (table and index) negatively impacts database performance and …
Author: Vonng (@Vonng) PostgreSQL uses MVCC as its primary concurrency control technology. While it has many benefits, it also brings other effects, such as relation bloat. Relation bloat (table and index) negatively impacts database performance and …
TimescaleDB Quick Start

Official website: https://www.timescale.com Official documentation: https://docs.timescale.com/v0.9/main Github: https://github.com/timescale/timescaledb Why Use TimescaleDB What is Time-Series Data? We keep talking about what “time-series data” is, …
Official website: https://www.timescale.com Official documentation: https://docs.timescale.com/v0.9/main Github: https://github.com/timescale/timescaledb Why Use TimescaleDB What is Time-Series Data? We keep talking about what “time-series data” is, …
Getting Started with PipelineDB

PipelineDB extends PostgreSQL with streaming primitives—continuous views over unbounded input. Although the upstream project was discontinued, the concepts remain useful. Install & configure PipelineDB ships as an extension. Install the RPM/DEB, then …
PipelineDB extends PostgreSQL with streaming primitives—continuous views over unbounded input. Although the upstream project was discontinued, the concepts remain useful. Install & configure PipelineDB ships as an extension. Install the RPM/DEB, then …
Incident-Report: PostgreSQL Transaction ID Wraparound

Encountered a transaction wraparound failure caused by disk bad blocks: Primary database (PostgreSQL 9.3) disk bad blocks caused VACUUM FREEZE execution failure on several tables. Unable to reclaim old transaction IDs, causing database transaction …
Encountered a transaction wraparound failure caused by disk bad blocks: Primary database (PostgreSQL 9.3) disk bad blocks caused VACUUM FREEZE execution failure on several tables. Unable to reclaim old transaction IDs, causing database transaction …
Incident-Report: Integer Overflow from Rapid Sequence Number Consumption

0x01 Overview Incident symptoms: A table using auto-increment columns had sequence numbers reach the integer limit, preventing writes. Discovered large gaps in auto-increment columns, with many sequence numbers consumed without corresponding …
0x01 Overview Incident symptoms: A table using auto-increment columns had sequence numbers reach the integer limit, preventing writes. Discovered large gaps in auto-increment columns, with many sequence numbers consumed without corresponding …
PostgreSQL Trigger Usage Considerations

Overview Trigger behavior overview Trigger classification Trigger functionality Trigger types Trigger firing Trigger creation Trigger modification Trigger queries Trigger performance Trigger Overview Trigger behavior overview: English, Chinese …
Overview Trigger behavior overview Trigger classification Trigger functionality Trigger types Trigger firing Trigger creation Trigger modification Trigger queries Trigger performance Trigger Overview Trigger behavior overview: English, Chinese …
GeoIP Geographic Reverse Lookup Optimization

Efficient implementation of IP geolocation lookups In application development, a ‘very common’ requirement is GeoIP conversion - converting source IP addresses from requests into corresponding geographic coordinates or administrative divisions …
Efficient implementation of IP geolocation lookups In application development, a ‘very common’ requirement is GeoIP conversion - converting source IP addresses from requests into corresponding geographic coordinates or administrative divisions …
PostgreSQL Development Convention (2018 Edition)

0x00 Background Without rules, there can be no order. PostgreSQL is extremely powerful, but to use PostgreSQL well requires coordinated effort from backend developers, operations teams, and DBAs. This article compiles a development specification …
0x00 Background Without rules, there can be no order. PostgreSQL is extremely powerful, but to use PostgreSQL well requires coordinated effort from backend developers, operations teams, and DBAs. This article compiles a development specification …
What Are PostgreSQL's Advantages?

PostgreSQL’s slogan is “The world’s most advanced open source relational database”, but I think this slogan isn’t catchy enough, and it looks like it’s targeting MySQL’s “The world’s most popular open source relational database” slogan, which seems …
PostgreSQL’s slogan is “The world’s most advanced open source relational database”, but I think this slogan isn’t catchy enough, and it looks like it’s targeting MySQL’s “The world’s most popular open source relational database” slogan, which seems …
KNN Ultimate Optimization: From RDS to PostGIS

Flexibly applying database functionality can easily achieve a 30,000-fold performance improvement in GIS selection scenarios. Level Method Performance/Time(ms) Maintainability/Reliability Notes 1 Brute Force 30,000 - Simple form 2 Coordinate Index 35 …
Flexibly applying database functionality can easily achieve a 30,000-fold performance improvement in GIS selection scenarios. Level Method Performance/Time(ms) Maintainability/Reliability Notes 1 Brute Force 30,000 - Simple form 2 Coordinate Index 35 …
Efficient Administrative Region Lookup with PostGIS

Author: Vonng (@Vonng) Original WeChat article In application development, we often need to solve this problem: determining administrative regions based on user coordinates. We collect coordinates like 28°00'00"N 100°00'00.000"E, but what we …
Author: Vonng (@Vonng) Original WeChat article In application development, we often need to solve this problem: determining administrative regions based on user coordinates. We collect coordinates like 28°00'00"N 100°00'00.000"E, but what we …
Monitoring Table Size in PostgreSQL

Table Space Layout In the broad sense, a Table includes two parts: the main table and TOAST table: Main table: stores the relation’s own data, i.e., the narrow sense relation, relkind='r'. TOAST table: corresponds one-to-one with the main table, …
Table Space Layout In the broad sense, a Table includes two parts: the main table and TOAST table: Main table: stores the relation’s own data, i.e., the narrow sense relation, relkind='r'. TOAST table: corresponds one-to-one with the main table, …
PgAdmin Installation and Configuration

PgAdmin4 Installation and Configuration PgAdmin is a GUI designed specifically for PostgreSQL. It works very well. It can run as either a local GUI program or a web service. Since PgAdmin’s GUI components have display issues on Retina screens, this …
PgAdmin4 Installation and Configuration PgAdmin is a GUI designed specifically for PostgreSQL. It works very well. It can run as either a local GUI program or a web service. Since PgAdmin’s GUI components have display issues on Retina screens, this …
Incident-Report: Uneven Load Avalanche

Author: Vonng (@Vonng) Recently there was a perplexing incident where a database had half its data volume and load migrated away. Everything else remained unchanged, and it was fine before. The pressure decreased, yet it fell into a near-death state …
Author: Vonng (@Vonng) Recently there was a perplexing incident where a database had half its data volume and load migrated away. Everything else remained unchanged, and it was fine before. The pressure decreased, yet it fell into a near-death state …
Implementing Mutual Exclusion Constraints with Exclude

Exclude constraint is a PostgreSQL extension that can implement more advanced and sophisticated database constraints. Introduction Data integrity is extremely important, but data integrity guaranteed by applications isn’t always reliable: humans make …
Exclude constraint is a PostgreSQL extension that can implement more advanced and sophisticated database constraints. Introduction Data integrity is extremely important, but data integrity guaranteed by applications isn’t always reliable: humans make …
Function Volatility Classification Levels

PostgreSQL functions have three volatility levels by default. Proper use can significantly improve performance. Core Differences VOLATILE: Has side effects, cannot be optimized. STABLE: Executes database queries. IMMUTABLE: Pure function, execution …
PostgreSQL functions have three volatility levels by default. Proper use can significantly improve performance. Core Differences VOLATILE: Has side effects, cannot be optimized. STABLE: Executes database queries. IMMUTABLE: Pure function, execution …
Distinct On: Remove Duplicate Data

Distinct On is a unique syntax provided by PostgreSQL that can efficiently solve typical query problems, for example, quickly finding records with maximum/minimum values within groups. Introduction Finding records with maximum/minimum values within …
Distinct On is a unique syntax provided by PostgreSQL that can efficiently solve typical query problems, for example, quickly finding records with maximum/minimum values within groups. Introduction Finding records with maximum/minimum values within …
PostgreSQL Routine Maintenance

Cars need oil changes, databases need maintenance. Maintenance Tasks in PG For PG, there are three important maintenance tasks: backup, repack, vacuum Backup: The most important routine work, a lifeline. Create base backups Archive incremental WAL …
Cars need oil changes, databases need maintenance. Maintenance Tasks in PG For PG, there are three important maintenance tasks: backup, repack, vacuum Backup: The most important routine work, a lifeline. Create base backups Archive incremental WAL …
Backup and Recovery Methods Overview

Author: Vonng (@Vonng) Backup is the foundation of a DBA’s livelihood. With backups, there’s no need to panic. There are three forms of backup: SQL dumps, file system backups, and continuous archiving. 1. SQL Dumps The idea behind the SQL dump …
Author: Vonng (@Vonng) Backup is the foundation of a DBA’s livelihood. With backups, there’s no need to panic. There are three forms of backup: SQL dumps, file system backups, and continuous archiving. 1. SQL Dumps The idea behind the SQL dump …
Pgbouncer Quick Start

Pgbouncer is a lightweight database connection pool. Synopsis pgbouncer [-d][-R][-v][-u user] <pgbouncer.ini> pgbouncer -V|-h Description pgbouncer is a PostgreSQL connection pooler. Any target application can connect to pgbouncer as if it were a …
Pgbouncer is a lightweight database connection pool. Synopsis pgbouncer [-d][-R][-v][-u user] <pgbouncer.ini> pgbouncer -V|-h Description pgbouncer is a PostgreSQL connection pooler. Any target application can connect to pgbouncer as if it were a …
PgBackRest2 Documentation

pgBackRest homepage: http://pgbackrest.org pgBackRest Github homepage: https://github.com/pgbackrest/pgbackrest Preface pgBackRest aims to provide a simple, reliable, easily scalable PostgreSQL backup and recovery system. pgBackRest doesn’t depend on …
pgBackRest homepage: http://pgbackrest.org pgBackRest Github homepage: https://github.com/pgbackrest/pgbackrest Preface pgBackRest aims to provide a simple, reliable, easily scalable PostgreSQL backup and recovery system. pgBackRest doesn’t depend on …
Changing Engines Mid-Flight — PostgreSQL Zero-Downtime Data Migration

Data migration typically involves stopping services for updates. Zero-downtime data migration is a relatively advanced operation. Zero-downtime data migration can essentially be viewed as consisting of three operations: Replication: Logical …
Data migration typically involves stopping services for updates. Zero-downtime data migration is a relatively advanced operation. Zero-downtime data migration can essentially be viewed as consisting of three operations: Replication: Logical …
Using sysbench to Test PostgreSQL Performance

sysbench homepage: https://github.com/akopytov/sysbench Installation Binary installation - on Mac, use brew to install sysbench: brew install sysbench --with-postgresql Source compilation (CentOS): yum -y install make automake libtool pkgconfig …
sysbench homepage: https://github.com/akopytov/sysbench Installation Binary installation - on Mac, use brew to install sysbench: brew install sysbench --with-postgresql Source compilation (CentOS): yum -y install make automake libtool pkgconfig …
Testing Disk Performance with FIO

Author: Vonng FIO is an excellent disk performance testing tool. You can test disk read/write performance using the following commands. fio --filename=/tmp/fio.data \ -direct=1 \ -iodepth=32 \ -rw=randrw \ --rwmixread=80 \ -bs=4k \ -size=1G \ …
Author: Vonng FIO is an excellent disk performance testing tool. You can test disk read/write performance using the following commands. fio --filename=/tmp/fio.data \ -direct=1 \ -iodepth=32 \ -rw=randrw \ --rwmixread=80 \ -bs=4k \ -size=1G \ …
PostgreSQL Server Log Regular Configuration

It’s recommended to configure PostgreSQL’s log format as CSV for easy analysis, and it can be directly imported into PostgreSQL data tables. Log-Related Configuration Items log_destination ='csvlog' logging_collector =on log_directory ='log' …
It’s recommended to configure PostgreSQL’s log format as CSV for easy analysis, and it can be directly imported into PostgreSQL data tables. Log-Related Configuration Items log_destination ='csvlog' logging_collector =on log_directory ='log' …
Finding Unused Indexes

Author: Vonng Indexes are useful, but they’re not free. Unused indexes are a waste. Use the following SQL to identify unused indexes: First, exclude indexes used to implement constraints (can’t be dropped) Expression indexes (containing field 0 in …
Author: Vonng Indexes are useful, but they’re not free. Unused indexes are a waste. Use the following SQL to identify unused indexes: First, exclude indexes used to implement constraints (can’t be dropped) Expression indexes (containing field 0 in …
Batch Configure SSH Passwordless Login

Configuring SSH is fundamental operations work - sometimes the basics need revisiting. Generate Public-Private Key Pairs Ideally, everything should use public-private key authentication for passwordless direct connection from local to all database …
Configuring SSH is fundamental operations work - sometimes the basics need revisiting. Generate Public-Private Key Pairs Ideally, everything should use public-private key authentication for passwordless direct connection from local to all database …
Wireshark Packet Capture Protocol Analysis

Wireshark is a very useful tool, especially suitable for analyzing network protocols. Here’s a simple introduction to using Wireshark for packet capture and PostgreSQL protocol analysis. Assuming debugging local PostgreSQL instance: 127.0.0.1:5432 …
Wireshark is a very useful tool, especially suitable for analyzing network protocols. Here’s a simple introduction to using Wireshark for packet capture and PostgreSQL protocol analysis. Assuming debugging local PostgreSQL instance: 127.0.0.1:5432 …
The Versatile file_fdw — Reading System Information from Your Database

Author: Vonng PostgreSQL is the most advanced open-source database, and one of its killer features is FDW: Foreign Data Wrapper. Through FDW, users can access various external data sources from Postgres in a unified manner. file_fdw is one of the …
Author: Vonng PostgreSQL is the most advanced open-source database, and one of its killer features is FDW: Foreign Data Wrapper. Through FDW, users can access various external data sources from Postgres in a unified manner. file_fdw is one of the …
Installing PostGIS from Source

Strongly recommend using yum / apt commands to install PostGIS from official PostgreSQL binary repositories. Reference: …
Strongly recommend using yum / apt commands to install PostGIS from official PostgreSQL binary repositories. Reference: …
Common Linux Statistics CLI Tools

top free vmstat iostat top Display Linux tasks Summary Press space or enter to force refresh Use h to open help Use l,t,m to collapse summary sections Use d to modify refresh interval Use z to enable color highlighting Use u to list processes for …
top free vmstat iostat top Display Linux tasks Summary Press space or enter to force refresh Use h to open help Use l,t,m to collapse summary sections Use d to modify refresh interval Use z to enable color highlighting Use u to list processes for …
Go Database Tutorial: database/sql

The conventional way Go uses SQL and SQL-like databases is through the standard library database/sql. This is a generic abstraction for relational databases that provides a standard, lightweight, row-oriented interface. However, the documentation for …
The conventional way Go uses SQL and SQL-like databases is through the standard library database/sql. This is a generic abstraction for relational databases that provides a standard, lightweight, row-oriented interface. However, the documentation for …
Implementing Cache Synchronization with Go and PostgreSQL

Parallel and Hierarchy are the two great principles of architectural design, and caching is the embodiment of Hierarchy in the IO domain. Implementing caching mechanisms in single-threaded scenarios can be surprisingly simple, but it’s hard to …
Parallel and Hierarchy are the two great principles of architectural design, and caching is the embodiment of Hierarchy in the IO domain. Implementing caching mechanisms in single-threaded scenarios can be surprisingly simple, but it’s hard to …
Auditing Data Changes with Triggers

Author: Vonng (@Vonng) Sometimes we want to record important metadata changes for audit purposes. PostgreSQL triggers can conveniently solve this need automatically. -- Create an audit-specific schema and revoke all non-superuser privileges DROP …
Author: Vonng (@Vonng) Sometimes we want to record important metadata changes for audit purposes. PostgreSQL triggers can conveniently solve this need automatically. -- Create an audit-specific schema and revoke all non-superuser privileges DROP …
Building an ItemCF Recommender in Pure SQL

Everyone knows “item-based collaborative filtering” (ItemCF): Amazon recommendations, YouTube watch-next, etc. Here’s how to implement it in PostgreSQL using the MovieLens dataset. No Python, just SQL. Theory in one minute ItemCF recommends items …
Everyone knows “item-based collaborative filtering” (ItemCF): Amazon recommendations, YouTube watch-next, etc. Here’s how to implement it in PostgreSQL using the MovieLens dataset. No Python, just SQL. Theory in one minute ItemCF recommends items …
UUID Properties, Principles and Applications

A recent project needed to generate business transaction IDs with the following requirements: IDs must be generated in a distributed manner, cannot depend on central node allocation while ensuring global uniqueness. IDs must contain timestamps and …
A recent project needed to generate business transaction IDs with the following requirements: IDs must be generated in a distributed manner, cannot depend on central node allocation while ensuring global uniqueness. IDs must contain timestamps and …
PostgreSQL MongoFDW Installation and Deployment

Update: Recently MongoFDW has been taken over by Cybertech for maintenance, so maybe it’s not as bad anymore. Recently had business requirements to access MongoDB through PostgreSQL FDW. Initially I thought this was a pretty easy task. But what …
Update: Recently MongoFDW has been taken over by Cybertech for maintenance, so maybe it’s not as bad anymore. Recently had business requirements to access MongoDB through PostgreSQL FDW. Initially I thought this was a pretty easy task. But what …