Blog Columns
Six thematic columns, each with its own dedicated RSS feed.
Database Guru
75posts
Database news, industry surveys, architecture, and best practices.
Cloud-Exiter
66posts
Cloud economics, repatriation, and building sovereign infrastructure.
Postgres Mage
126posts
PostgreSQL ecosystem, internals, extensions, and production tuning.
AI Agent Explorer
97posts
Practical engineering with coding agents, LLMs, AI4DB, and DB4AI.
Travel Notes
12posts
Trips, hikes, landscapes, and field notes across mountains and seas.
Miscellaneous
40posts
Essays, reflections, and personal writing inside and outside of tech.

The WeChat Photo Album Access Issue
I saw news about WeChat accessing user photo albums in the background. While such shady behavior from Chinese apps doesn't surprise me, in the spirit of seeking truth, I got up this morning to …

Life at 28
My solar birthday falling on Mid-Autumn Festival is something that will only happen three times in my lifetime. Theoretically, this should be a memorable day, but the events of this year have left me …

Pigsty v1.0: GA Release with Monitoring Overhaul
Pigsty v1.0.0 GA is here — a batteries-included, open-source PostgreSQL distribution ready for production.

Majestic Southern Taihang
From Xinxiang, Henan, crossing the Taihang Mountains to Shanxi

On the Hills of Manchuria
Standing on the hills of Manchuria, on the grasslands of Hulunbuir.

Ready-to-Use PostgreSQL Distribution: Pigsty
Yesterday I gave a live presentation in the PostgreSQL Chinese community, introducing the open-source PostgreSQL full-stack solution — Pigsty

Why Does PostgreSQL Have a Bright Future?
Databases are the core component of information systems, relational databases are the absolute backbone of databases, and PostgreSQL is the world's most advanced open source relational database. With …

Pigsty v0.9: CLI + Logs
One-click installs, a beta CLI, and Loki-based logging make Pigsty easier to land.

Pigsty v0.8: Service Provisioning
Services are now first-class objects, so you can define any routing policy—built-in HAProxy, L4 VIPs, or your own balancer.

Localization and Collation Rules in PostgreSQL
What? Don't know what COLLATION is? Remember one thing: using C COLLATE is always the right choice!

Implementing Advanced Fuzzy Search
How to implement relatively complex fuzzy search logic in PostgreSQL?

PostgreSQL Logical Replication Deep Dive
This article introduces the principles and best practices of logical replication in PostgreSQL 13.

PG Replica Identity Explained
Replica identity is important - it determines the success or failure of logical replication

Pigsty v0.7: Monitor-Only Deployments
Monitor-only deployments unlock hybrid fleets, while DB/user provisioning APIs get a serious cleanup.

A Methodology for Diagnosing PostgreSQL Slow Queries
Slow queries are the sworn enemy of OLTP databases. Here’s how to identify, analyze, and fix them using metrics (Pigsty dashboards), pg_stat_statements, and logs.

Incident-Report: Patroni Failure Due to Time Travel
Machine restarted due to failure, NTP service corrected PG time after PG startup, causing Patroni to fail to start.

Pigsty v0.6: Provisioning Upgrades
v0.6 reworks the provisioning flow, adds exporter toggles, and makes the monitoring stack portable across environments.

Urban Wandering: Guangzhou Observations
Taking advantage of attending the 2020 PostgreSQL China Conference, I toured Guangzhou for a day. A quite interesting place.

Online Primary Key Column Type Change
How to change column types online, such as upgrading from INT to BIGINT?

New Year Pilgrimage: Yubeng Mountain Circuit
The disaster-filled year 2020 required proper blessings. Completed the Meili inner circuit in 3 days - Sacred Waterfall, Sacred Lake, Ice Lake.

Farewell to Grandfather
Grandfather has passed away. I am beyond grief, but I should still write something in his memory.

Pigsty v0.5: Declarative DB Templates
Pigsty v0.5 introduces declarative database templates so roles, schemas, extensions, and ACLs can be described entirely in YAML.

Pigsty v0.4: PG13 and Better Docs
Pigsty v0.4 ships PG13 support, a Grafana 7.3 refresh, and a cleaned-up docs site for the second public beta.

Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation
Understanding the golden monitoring metrics in PostgreSQL

The WeChat Photo Album Access Issue
I saw news about WeChat accessing user photo albums in the background. While such shady behavior from Chinese apps doesn't surprise me, in the spirit of seeking truth, I got up this morning to …

Life at 28
My solar birthday falling on Mid-Autumn Festival is something that will only happen three times in my lifetime. Theoretically, this should be a memorable day, but the events of this year have left me …

Pigsty v1.0: GA Release with Monitoring Overhaul
Pigsty v1.0.0 GA is here — a batteries-included, open-source PostgreSQL distribution ready for production.

Majestic Southern Taihang
From Xinxiang, Henan, crossing the Taihang Mountains to Shanxi

On the Hills of Manchuria
Standing on the hills of Manchuria, on the grasslands of Hulunbuir.

Ready-to-Use PostgreSQL Distribution: Pigsty
Yesterday I gave a live presentation in the PostgreSQL Chinese community, introducing the open-source PostgreSQL full-stack solution — Pigsty

Why Does PostgreSQL Have a Bright Future?
Databases are the core component of information systems, relational databases are the absolute backbone of databases, and PostgreSQL is the world's most advanced open source relational database. With …

Pigsty v0.9: CLI + Logs
One-click installs, a beta CLI, and Loki-based logging make Pigsty easier to land.

Pigsty v0.8: Service Provisioning
Services are now first-class objects, so you can define any routing policy—built-in HAProxy, L4 VIPs, or your own balancer.

Localization and Collation Rules in PostgreSQL
What? Don't know what COLLATION is? Remember one thing: using C COLLATE is always the right choice!

Implementing Advanced Fuzzy Search
How to implement relatively complex fuzzy search logic in PostgreSQL?

PostgreSQL Logical Replication Deep Dive
This article introduces the principles and best practices of logical replication in PostgreSQL 13.

PG Replica Identity Explained
Replica identity is important - it determines the success or failure of logical replication

Pigsty v0.7: Monitor-Only Deployments
Monitor-only deployments unlock hybrid fleets, while DB/user provisioning APIs get a serious cleanup.

A Methodology for Diagnosing PostgreSQL Slow Queries
Slow queries are the sworn enemy of OLTP databases. Here’s how to identify, analyze, and fix them using metrics (Pigsty dashboards), pg_stat_statements, and logs.

Incident-Report: Patroni Failure Due to Time Travel
Machine restarted due to failure, NTP service corrected PG time after PG startup, causing Patroni to fail to start.

Pigsty v0.6: Provisioning Upgrades
v0.6 reworks the provisioning flow, adds exporter toggles, and makes the monitoring stack portable across environments.

Urban Wandering: Guangzhou Observations
Taking advantage of attending the 2020 PostgreSQL China Conference, I toured Guangzhou for a day. A quite interesting place.

Online Primary Key Column Type Change
How to change column types online, such as upgrading from INT to BIGINT?

New Year Pilgrimage: Yubeng Mountain Circuit
The disaster-filled year 2020 required proper blessings. Completed the Meili inner circuit in 3 days - Sacred Waterfall, Sacred Lake, Ice Lake.

Farewell to Grandfather
Grandfather has passed away. I am beyond grief, but I should still write something in his memory.

Pigsty v0.5: Declarative DB Templates
Pigsty v0.5 introduces declarative database templates so roles, schemas, extensions, and ACLs can be described entirely in YAML.

Pigsty v0.4: PG13 and Better Docs
Pigsty v0.4 ships PG13 support, a Grafana 7.3 refresh, and a cleaned-up docs site for the second public beta.

Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation
Understanding the golden monitoring metrics in PostgreSQL
The WeChat Photo Album Access Issue

Original WeChat Official Account Article Last night, I saw news about WeChat accessing user photo albums in the background, and WeChat responded: While such shady behavior from Chinese apps doesn’t surprise me, in the spirit of seeking truth, I got …
Original WeChat Official Account Article Last night, I saw news about WeChat accessing user photo albums in the background, and WeChat responded: While such shady behavior from Chinese apps doesn’t surprise me, in the spirit of seeking truth, I got …
Life at 28

Life at 28 Another Mid-Autumn Festival, another year older. My solar birthday (September 21st) coinciding with Mid-Autumn Festival should only happen three times in my lifetime: once at age 9 in 2002, once at age 28 in 2021, and the last time at age …
Life at 28 Another Mid-Autumn Festival, another year older. My solar birthday (September 21st) coinciding with Mid-Autumn Festival should only happen three times in my lifetime: once at age 9 in 2002, once at age 28 in 2021, and the last time at age …
Pigsty v1.0: GA Release with Monitoring Overhaul

GitHub Release | Release Note After over a year of iterations and refinement, Pigsty officially ships v1.0.0 GA. Pigsty (/ˈpɪɡˌstaɪ/) stands for PostgreSQL In Graphic STYle — PostgreSQL, visualized. What is Pigsty? Pigsty is a batteries-included …
GitHub Release | Release Note After over a year of iterations and refinement, Pigsty officially ships v1.0.0 GA. Pigsty (/ˈpɪɡˌstaɪ/) stands for PostgreSQL In Graphic STYle — PostgreSQL, visualized. What is Pigsty? Pigsty is a batteries-included …
On the Hills of Manchuria

The Dragon Boat Festival holiday coincided with college entrance exams. Not wanting to see crowds everywhere, I discussed with two colleagues and decided to find a weekend for early off-peak travel. We settled on Hulunbuir - Friday night flight from …
The Dragon Boat Festival holiday coincided with college entrance exams. Not wanting to see crowds everywhere, I discussed with two colleagues and decided to find a weekend for early off-peak travel. We settled on Hulunbuir - Friday night flight from …
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 …
Pigsty v0.9: CLI + Logs

GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.9.0 New Stuff One-liner install: curl -fsSL https://pigsty.cc/install | bash bootstraps everything. pigsty-cli: wraps the common Ansible playbooks so you stop copy-pasting command …
GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.9.0 New Stuff One-liner install: curl -fsSL https://pigsty.cc/install | bash bootstraps everything. pigsty-cli: wraps the common Ansible playbooks so you stop copy-pasting command …
Pigsty v0.8: Service Provisioning

GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.8.0 v0.8 finalizes the provisioning API. Services are completely rebuilt: instead of a hard-coded primary/replica pair you can now declare any number of services, plug in HAProxy, swap …
GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.8.0 v0.8 finalizes the provisioning API. Services are completely rebuilt: instead of a hard-coded primary/replica pair you can now declare any number of services, plug in HAProxy, swap …
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 …
Pigsty v0.7: Monitor-Only Deployments

GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.7.0 Pigsty v0.7 focuses on plugging existing fleets into Pigsty’s observability stack. The new monitor-only flow lets you drop Pigsty dashboards onto databases that were provisioned …
GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.7.0 Pigsty v0.7 focuses on plugging existing fleets into Pigsty’s observability stack. The new monitor-only flow lets you drop Pigsty dashboards onto databases that were provisioned …
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 …
Pigsty v0.6: Provisioning Upgrades

GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.6.0 Pigsty v0.6 responds to user feedback with a redesigned provisioning path plus a monitoring stack that can sit beside any managed PG fleet—even a MyBase cluster built elsewhere. Bug …
GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.6.0 Pigsty v0.6 responds to user feedback with a redesigned provisioning path plus a monitoring stack that can sit beside any managed PG fleet—even a MyBase cluster built elsewhere. Bug …
Urban Wandering: Guangzhou Observations

Taking advantage of attending the 2020 PostgreSQL China Conference, I toured Guangzhou for a day. A quite interesting place. Among the four first-tier cities, only Guangzhou remained unvisited. This time, leveraging the PG conference opportunity, I …
Taking advantage of attending the 2020 PostgreSQL China Conference, I toured Guangzhou for a day. A quite interesting place. Among the four first-tier cities, only Guangzhou remained unvisited. This time, leveraging the PG conference opportunity, I …
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 …
New Year Pilgrimage: Yubeng Mountain Circuit

The disaster-filled year 2020 required proper blessings. Completed the Meili inner circuit in 3 days - Sacred Waterfall, Sacred Lake, Ice Lake. Preface: As the saying goes: “If not going to paradise, go to Yubeng.” Going to Yubeng usually means …
The disaster-filled year 2020 required proper blessings. Completed the Meili inner circuit in 3 days - Sacred Waterfall, Sacred Lake, Ice Lake. Preface: As the saying goes: “If not going to paradise, go to Yubeng.” Going to Yubeng usually means …
Farewell to Grandfather

Although 2020 was a year of many disasters, until grandfather’s death, I always thought we could somehow get by. The death of a close relative—this is the second time for me. First my father, then my grandfather. Humans appear so powerless before …
Although 2020 was a year of many disasters, until grandfather’s death, I always thought we could somehow get by. The death of a close relative—this is the second time for me. First my father, then my grandfather. Humans appear so powerless before …
Pigsty v0.5: Declarative DB Templates

GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.5.0 v0.5.0 Outline The official docs site (http://pigsty.cc/) is live. Database templating becomes fully declarative: define users, roles, databases, ACLs, extensions, and schemas in …
GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.5.0 v0.5.0 Outline The official docs site (http://pigsty.cc/) is live. Database templating becomes fully declarative: define users, roles, databases, ACLs, extensions, and schemas in …
Pigsty v0.4: PG13 and Better Docs

GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.4.0 Pigsty v0.4 is our second public beta. The observability stack was rebuilt around Grafana 7.3, and ten curated dashboards became the default open-source payload. pg_exporter 0.3.1 …
GitHub Release: https://github.com/pgsty/pigsty/releases/tag/v0.4.0 Pigsty v0.4 is our second public beta. The observability stack was rebuilt around Grafana 7.3, and ten curated dashboards became the default open-source payload. pg_exporter 0.3.1 …
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 …
