Skip to content

Tag: PostgreSQL

  • Did PostgreSQL Win Because Oracle Screwed Up?

    By Ruohang Feng In Database 4050 words 20 min

    Ruohang FengPostgreSQLOpen SourceGovernanceCloud

    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

    By Ruohang Feng In Database 3358 words 16 min

    Ruohang FengPostgreSQLPigstyRepository

    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

    By Ruohang Feng In AI 2483 words 12 min

    Ruohang FengAIPostgreSQLSoftware EngineeringDatabase

    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

    By Ruohang Feng In PGSQL 811 words 4 min

    Ruohang FengPostgreSQLPG EcosystemOpen Source

    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

    By Ruohang Feng In PGSQL 714 words 4 min

    Ruohang FengPostgreSQLPigstyTools

    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?

    By Ruohang Feng In PGSQL 3218 words 16 min

    Ruohang FengPostgreSQLPigsty

    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

    By Ruohang Feng In AI 3931 words 19 min

    Ruohang FengAIAgentPostgreSQLDatabase

    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

    By Ruohang Feng In PGSQL 3122 words 15 min

    Ruohang FengPostgreSQLPG EcosystemExtension

    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

    By Ruohang Feng In PGSQL 1000 words 5 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 2434 words 12 min

    Ruohang FengPostgreSQLPG EcosystemOpen Source

    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

    By Ruohang Feng In PGSQL 2880 words 14 min

    Ruohang FengPostgreSQLPG EcosystemOpen Source

    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

    By Ruohang Feng In AI 4829 words 23 min

    Ruohang FengAIAgentPostgreSQLPigsty

    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

    By Ruohang Feng In Database 2234 words 5 min

    Ruohang FengMySQL走好MySQLPostgreSQLDatabaseCommentary

    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

    By Ruohang Feng In AI 2769 words 13 min

    Ruohang FengAIAgentPostgreSQLDatabase

    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

    By Ruohang Feng In PGSQL 5867 words 28 min

    Ruohang FengPostgreSQLPG EcosystemExtension

    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

    By Ruohang Feng In AI 3615 words 17 min

    Ruohang FengAIPostgreSQLAgentDatabase

    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

    By Ruohang Feng In PGSQL 1906 words 9 min

    Ruohang FengPostgreSQLMySQLPG Ecosystem

    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

    By Ruohang Feng In Cloud-Exit 2563 words 13 min

    Ruohang FengPostgreSQLCloudAlibaba Cloud

    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

    By Ruohang Feng In Database 2095 words 10 min

    Ruohang FengPostgreSQLAIAgentPigsty

    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

    By Ruohang Feng In Database 582 words 3 min

    Ruohang FengAIPostgreSQLOpen Source

    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?

    By Ruohang Feng In PGSQL 1053 words 5 min

    Ruohang FengPostgreSQLOracleDomestic Database

    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

    By Ruohang Feng In PGSQL 1620 words 4 min

    Ruohang FengPostgreSQLPG Admin

    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

    In AI 1828 words 9 min

    AIAgentPostgreSQLPigsty

    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

    In AI 1405 words 7 min

    AIAgentPostgreSQLLinux

    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

    In AI 3040 words 15 min

    AIAgentPostgreSQLLinux

    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

    By Ruohang Feng In PGSQL 2416 words 12 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In PGSQL 1659 words 8 min

    Ruohang FengPostgreSQLPG DevelopmentGIS

    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

    By Andy Pavlo, Mike Stonebraker, Ruohang Feng In Database 9707 words 46 min

    Andy PavloMike StonebrakerRuohang FengPostgreSQLDatabasePG Ecosystem

    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?

    By Ruohang Feng In Database 1609 words 8 min

    Ruohang FengPostgreSQLAIAgentDatabase

    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

    By Ruohang Feng In PGSQL 1155 words 6 min

    Ruohang FengPostgreSQLAIDatabase

    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

    By Ruohang Feng In PGSQL 526 words 3 min

    Ruohang FengPostgreSQLPigsty

    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!

    By Ruohang Feng In Database 1868 words 9 min

    Ruohang FengPostgreSQLContainersIncident

    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

    In PGSQL 444 words 3 min

    PostgreSQLExtension

    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

    By Ruohang Feng In PGSQL 1770 words 9 min

    Ruohang FengPostgreSQLPG Admin

    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

    In PGSQL 467 words 3 min

    PostgreSQL

    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?

    By Ruohang Feng In PGSQL 2680 words 13 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 1437 words 7 min

    Ruohang FengPostgreSQLPG Ecosystem

    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?

    By Ruohang Feng In Database 614 words 2 min

    Ruohang FengPostgreSQLDatabaseCommentarySociety

    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?

    By Ruohang Feng In AI 1220 words 6 min

    Ruohang FengAgentPostgreSQLAILLM

    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

    By Ruohang Feng In PGSQL 649 words 4 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In Database 1611 words 8 min

    Ruohang FengAIPostgreSQLDatabaseOpen Source

    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

    By Bohan Zhang In Database 2708 words 13 min

    Bohan ZhangPostgreSQLCodexPerformanceArchitecture

    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

    In AI 792 words 4 min

    PostgreSQLAIAgentDatabase

    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 Database 1811 words 4 min

    MySQL走好MySQLPostgreSQLDatabaseSoftware Engineering

    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!

    In PGSQL 1889 words 9 min

    PostgreSQLExtension

    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

    In PGSQL 1429 words 3 min

    PostgreSQL

    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!

    In PGSQL 709 words 4 min

    PostgreSQLMySQL

    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

    By Ruohang Feng In PGSQL 1567 words 8 min

    Ruohang FengPostgreSQLObject Storage

    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

    By Ruohang Feng In Database 1504 words 8 min

    Ruohang FengPostgreSQLOLAPDatabase

    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?

    In Cloud-Exit 734 words 4 min

    BlogPostgreSQLAlibaba CloudPG EcosystemOpen Source

    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

    By Laurenz Albe In Database 828 words 4 min

    Laurenz AlbePostgreSQLOracleDatabaseTransactions

    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

    By Ruohang Feng In PGSQL 1846 words 9 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In Database 1830 words 9 min

    Ruohang FengPostgreSQLDatabaseArchitecturePG Ecosystem

    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

    By Ruohang Feng In PGSQL 537 words 3 min

    Ruohang FengPostgreSQLTools

    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

    In Database 1591 words 8 min

    PostgreSQLMySQLDatabase

    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)

    By Matt Blewitt In Database 2096 words 10 min

    Matt BlewittPostgreSQLOLAPDatabaseTranslation

    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

    By Ruohang Feng In PGSQL 1846 words 9 min

    Ruohang FengPostgreSQL

    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

    By Ruohang Feng In PGSQL 1604 words 8 min

    Ruohang FengPostgreSQL

    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

    By Ruohang Feng In PGSQL 1880 words 9 min

    Ruohang FengPostgreSQLPG EcosystemExtension

    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!

    By Ruohang Feng In PGSQL 2695 words 13 min

    Ruohang FengPostgreSQL

    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

    By Ruohang Feng In Database 2399 words 12 min

    Ruohang FengMongoDBPostgreSQLDatabasePG Ecosystem

    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?

    In Database 9633 words 46 min

    MongoDBPostgreSQLDatabaseCommentary

    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?

    By Ruohang Feng In PGSQL 750 words 4 min

    Ruohang FengPostgreSQLMySQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 1319 words 7 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 656 words 4 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 1234 words 6 min

    Ruohang FengPostgreSQLPigstyContainers

    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

    By Ruohang Feng In PGSQL 3392 words 16 min

    Ruohang FengPostgreSQLPG Ecosystem

    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!

    By Ruohang Feng In PGSQL 1347 words 7 min

    Ruohang FengPostgreSQL

    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

    By Ruohang Feng In PGSQL 2638 words 13 min

    Ruohang FengPostgreSQLPG EcosystemExtension

    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

    By Ruohang Feng In PGSQL 981 words 5 min

    Ruohang FengPostgreSQLPG EcosystemTranslation

    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

    By Ruohang Feng In PGSQL 870 words 5 min

    Ruohang FengPostgreSQLPG EcosystemExtension

    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

    By Ruohang Feng In PGSQL 2161 words 11 min

    Ruohang FengPostgreSQLPerformanceTranslation

    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)

    By Ruohang Feng In PGSQL 722 words 4 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 7915 words 38 min

    Ruohang FengPostgreSQLPG Development

    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

    By Nikolay Samokhvalov In PGSQL 4334 words 21 min

    Nikolay SamokhvalovPostgreSQLPG AdminPerformance

    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

    By Ruohang Feng In PGSQL 1230 words 6 min

    Ruohang FengPostgreSQLMongoDBPG EcosystemExtension

    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?

    By Ruohang Feng In PGSQL 2801 words 14 min

    Ruohang FengPostgreSQLPG AdminIncident

    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

    By Ruohang Feng In PGSQL 3055 words 7 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 1931 words 10 min

    Ruohang FengPostgreSQLPG DevelopmentExtensionVector

    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?

    By Ruohang Feng In PGSQL 2308 words 11 min

    Ruohang FengPostgreSQLPG EcosystemPerformance

    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?

    By Ruohang Feng In PGSQL 3092 words 15 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 2044 words 10 min

    Ruohang FengPostgreSQLPigstyRDS

    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?

    By Ruohang Feng In PGSQL 4900 words 24 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 2707 words 6 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In PGSQL 3238 words 7 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 6503 words 31 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In PGSQL 2202 words 11 min

    Ruohang FengPostgreSQLPG AdminPG Development

    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

    By Ruohang Feng In PGSQL 349 words 2 min

    Ruohang FengPostgreSQLPG AdminPerformance

    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

    By Ruohang Feng In PGSQL 145 words 1 min

    Ruohang FengPostgreSQLPG AdminIncident

    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

    By Ruohang Feng In PGSQL 1169 words 6 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In PGSQL 1235 words 6 min

    Ruohang FengPostgreSQLPG AdminMonitoring

    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

    By Ruohang Feng In PGSQL 1497 words 8 min

    Ruohang FengPostgreSQLPG AdminArchitecture

    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

    By Ruohang Feng In PGSQL 3038 words 15 min

    Ruohang FengPostgreSQLPG AdminMonitoring

    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

    By Ruohang Feng In PGSQL 786 words 4 min

    Ruohang FengPostgreSQLPG AdminMigration

    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

    By Ruohang Feng In PGSQL 2692 words 13 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 870 words 5 min

    Ruohang FengPostgreSQLPG DevelopmentPG Kernel

    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

    By Ruohang Feng In PGSQL 433 words 3 min

    Ruohang FengPostgreSQLPG AdminExtensionIncident

    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

    By Ruohang Feng In PGSQL 4557 words 22 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 486 words 3 min

    Ruohang FengPostgreSQLPG DevelopmentPG Admin

    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

    By Ruohang Feng In PGSQL 673 words 4 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 575 words 3 min

    Ruohang FengPostgreSQLPG AdminArchitecture

    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

    By Ruohang Feng In PGSQL 761 words 4 min

    Ruohang FengPostgreSQLPG AdminBackup

    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

    By Ruohang Feng In PGSQL 1232 words 6 min

    Ruohang FengPostgreSQLPG AdminIncident

    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

    By Ruohang Feng In PGSQL 2725 words 13 min

    Ruohang FengPostgreSQLPG AdminIncident

    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

    By Ruohang Feng In PGSQL 3167 words 15 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In PGSQL 3993 words 19 min

    Ruohang FengPostgreSQLPG AdminExtension

    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

    By Ruohang Feng In PGSQL 207 words 1 min

    Ruohang FengPostgreSQLPG AdminExtension

    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

    By Ruohang Feng In PGSQL 956 words 5 min

    Ruohang FengPostgreSQLPG AdminIncident

    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

    By Ruohang Feng In PGSQL 645 words 4 min

    Ruohang FengPostgreSQLPG AdminIncident

    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

    By Ruohang Feng In PGSQL 1053 words 5 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 1545 words 8 min

    Ruohang FengPostgreSQLPG DevelopmentExtensionGIS

    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)

    By Ruohang Feng In PGSQL 3431 words 17 min

    Ruohang FengPostgreSQLPG DevelopmentSoftware Engineering

    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?

    By Ruohang Feng In PGSQL 2148 words 11 min

    Ruohang FengPostgreSQLPG Ecosystem

    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

    By Ruohang Feng In PGSQL 4090 words 20 min

    Ruohang FengPostgreSQLPG DevelopmentMachine LearningGIS

    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

    By Ruohang Feng In PGSQL 2166 words 11 min

    Ruohang FengPostgreSQLPG DevelopmentGIS

    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

    By Ruohang Feng In PGSQL 903 words 5 min

    Ruohang FengPostgreSQLPG AdminMonitoring

    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

    By Ruohang Feng In PGSQL 216 words 2 min

    Ruohang FengPostgreSQLPG AdminTools

    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

    By Ruohang Feng In PGSQL 1318 words 7 min

    Ruohang FengPostgreSQLPG AdminIncident

    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

    By Ruohang Feng In PGSQL 850 words 4 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 638 words 3 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 553 words 3 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 126 words 1 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In PGSQL 3982 words 19 min

    Ruohang FengPostgreSQLPG AdminBackup

    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

    By Ruohang Feng In PGSQL 2876 words 14 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In PGSQL 3109 words 15 min

    Ruohang FengPostgreSQLPG AdminBackup

    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

    By Ruohang Feng In PGSQL 673 words 4 min

    Ruohang FengPostgreSQLPG AdminMigration

    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

    By Ruohang Feng In PGSQL 298 words 2 min

    Ruohang FengPostgreSQLPG AdminPerformance

    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

    By Ruohang Feng In PGSQL 335 words 2 min

    Ruohang FengPostgreSQLPG AdminPerformance

    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

    By Ruohang Feng In PGSQL 654 words 4 min

    Ruohang FengPostgreSQLPG AdminMonitoring

    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

    By Ruohang Feng In PGSQL 373 words 2 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In PGSQL 292 words 2 min

    Ruohang FengPostgreSQLPG Admin

    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

    By Ruohang Feng In PGSQL 979 words 5 min

    Ruohang FengPostgreSQLPG AdminTools

    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

    By Ruohang Feng In PGSQL 842 words 4 min

    Ruohang FengPostgreSQLPG AdminExtension

    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

    By Ruohang Feng In PGSQL 608 words 3 min

    Ruohang FengPostgreSQLPG AdminExtension

    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

    By Ruohang Feng In PGSQL 2358 words 12 min

    Ruohang FengPostgreSQLPG AdminTools

    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

    By Ruohang Feng In PGSQL 4213 words 20 min

    Ruohang FengPostgreSQLSoftware Engineering

    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

    By Ruohang Feng In PGSQL 1226 words 6 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 477 words 3 min

    Ruohang FengPostgreSQLPG Development

    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

    By Ruohang Feng In PGSQL 408 words 2 min

    Ruohang FengPostgreSQLPG DevelopmentMachine Learning

    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

    By Ruohang Feng In PGSQL 1678 words 8 min

    Ruohang FengPostgreSQLPG DevelopmentArchitecture

    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

    By Ruohang Feng In PGSQL 699 words 4 min

    Ruohang FengPostgreSQLPG AdminExtension

    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 …