Skip to content

Tag: PG Admin

  • Meituan Deleted Users' Photos: Overbroad Permissions Are Worse Than a Privacy Leak

    By Ruohang Feng In Cloud-Exit 834 words 4 min

    Ruohang FengHardwarePG AdminSecurity

    Meituan Deleted Users' Photos: Overbroad Permissions Are Worse Than a Privacy Leak

    Starting on March 18, 2026, a large number of Android users discovered that Meituan had wiped files from their galleries. Photos, videos, audio recordings, PDFs, Word documents: sometimes hundreds of files, sometimes thousands. Android’s own …

    Starting on March 18, 2026, a large number of Android users discovered that Meituan had wiped files from their galleries. Photos, videos, audio recordings, PDFs, Word documents: sometimes hundreds of files, sometimes thousands. Android’s own …

  • 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 …

  • 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, …

  • On Trusting Open-Source Supply Chains

    In Database 748 words 4 min

    RepositoryPG AdminOpen Source

    On Trusting Open-Source Supply Chains

    Yesterday’s post “PG ‘Export Controls’ and Supply-Chain Trust” drew a comment from someone claiming to be an admin at a university mirror site (Tsinghua TUNA): “As a university mirror admin, calling us ‘lying flat’ or ‘irresponsible’ is unfair and …

    Yesterday’s post “PG ‘Export Controls’ and Supply-Chain Trust” drew a comment from someone claiming to be an admin at a university mirror site (Tsinghua TUNA): “As a university mirror admin, calling us ‘lying flat’ or ‘irresponsible’ is unfair and …

  • 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 …

  • 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 …

  • Where Will Databases and DBAs Go in the AI Era?

    By Ruohang Feng In Database 1591 words 8 min

    Ruohang FengAIDatabasePG AdminCareer

    Where Will Databases and DBAs Go in the AI Era?

    The day before yesterday at the HOW 2025 conference roundtable, Chairman Xiao asked some interesting questions about AI, databases, and DBAs. Here are Feng’s views, organized and published. OLTP / OLAP: Who Gets Revolutionized First? Question: In …

    The day before yesterday at the HOW 2025 conference roundtable, Chairman Xiao asked some interesting questions about AI, databases, and DBAs. Here are Feng’s views, organized and published. OLTP / OLAP: Who Gets Revolutionized First? Question: In …

  • Will DBAs Be Eliminated by Cloud?

    By Ruohang Feng In Cloud-Exit 3598 words 17 min

    Ruohang FengCloud-ExitPG AdminRDS

    Will DBAs Be Eliminated by Cloud?

    Two days ago, the ninth episode of Open-Source Talks had the theme “Will DBAs Be Eliminated by Cloud?” As the host, I restrained myself from jumping into the debate throughout, so I’m writing this article to discuss this question: Will DBAs be …

    Two days ago, the ninth episode of Open-Source Talks had the theme “Will DBAs Be Eliminated by Cloud?” As the host, I restrained myself from jumping into the debate throughout, so I’m writing this article to discuss this question: Will DBAs be …

  • 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 …

  • Which EL-Series OS Distribution Is Best?

    By Ruohang Feng In Database 1587 words 4 min

    Ruohang Feng信创国产化Domestic DatabaseLinuxPG AdminDatabase

    Which EL-Series OS Distribution Is Best?

    Many users have asked me what operating system is best for running databases. Especially considering that CentOS 7.9 will reach EOL next year, many users should need to upgrade their OS, so today I’m sharing some experience. TL;DR In short, if you’re …

    Many users have asked me what operating system is best for running databases. Especially considering that CentOS 7.9 will reach EOL next year, many users should need to upgrade their OS, so today I’m sharing some experience. TL;DR In short, if you’re …

  • 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 …

  • Refuting "Why You Still Shouldn't Hire a DBA"

    By Ruohang Feng In Cloud-Exit 2338 words 11 min

    Ruohang FengCloud-ExitRDSPG Admin

    Refuting "Why You Still Shouldn't Hire a DBA"

    Guo Degang has a comedy routine: “Say I tell a rocket scientist, your rocket is no good, the fuel is wrong. I think it should burn wood, better yet coal, and it has to be premium coal, not washed coal. If that scientist takes me seriously, he …

    Guo Degang has a comedy routine: “Say I tell a rocket scientist, your rocket is no good, the fuel is wrong. I think it should burn wood, better yet coal, and it has to be premium coal, not washed coal. If that scientist takes me seriously, he …

  • Is DBA Still a Good Job?

    By Ruohang Feng In Cloud-Exit 1538 words 8 min

    Ruohang FengCloud-ExitRDSPG Admin

    Is DBA Still a Good Job?

    Ant Financial had a self-deprecating joke: besides regulation, only DBAs could bring down Alipay. In the digital age, data is the core asset of many enterprises, especially for internet/software service companies. The people responsible for …

    Ant Financial had a self-deprecating joke: besides regulation, only DBAs could bring down Alipay. In the digital age, data is the core asset of many enterprises, especially for internet/software service companies. The people responsible for …

  • Cloud RDS: From Database Drop to Exit

    By Ruohang Feng In Cloud-Exit 916 words 5 min

    Ruohang FengCloud-ExitPG AdminRDS

    Cloud RDS: From Database Drop to Exit

    In my previous article “Is DBA Still a Good Job”, I mentioned: Although DBA as a profession is declining, who knows if DBAs might become trendy again after several terrifying large-scale cloud database failures. Well, I recently witnessed a live …

    In my previous article “Is DBA Still a Good Job”, I mentioned: Although DBA as a profession is declining, who knows if DBAs might become trendy again after several terrifying large-scale cloud database failures. Well, I recently witnessed a live …

  • 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 …

  • 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 …

  • 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": …

  • 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 …

  • 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 …

  • 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 …

  • 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 …

  • 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 …