B
Most teams treat OS patching as simple housekeeping. You apply the updates, reboot if needed, and move on. But on a PostgreSQL server, OS patching can also update database tools that were installed from the PostgreSQL package repository. When one of those tools has to talk to the same tool on another server, updating only one side can break things without any warning. That is exactly what happened to one of our customers recently. A normal patch night upgraded pgBackRest on the production…
B
A regulated payments company just moved more than 40 TB of production data onto a new EDB Postgres cluster. The cutover started at 2 AM local time. By morning, the application was back online, and the client’s team confirmed in writing that every post-cutover validation check had passed. That night was quiet because of everything that happened in the months before it. In September I wrote about pushing this go-live date back on purpose, and about the playbook we use to de-risk a…
B
A customer asked me recently how to optimize performance writing to PostgreSQL from a Flink pipeline. Without hesitation, I recommended using PostgreSQL’s COPY interface. The result was approximately twice the throughput. This post explores what makes COPY different, and when you should consider using it. To be fair, my recommendation hadn’t come out of nowhere. I had previously had experience building high performance PostgreSQL applications on large datasets using COPY and have significant…
B
A deadlock happens when two transactions are each waiting for something the other one is holding. Neither transaction can continue, so PostgreSQL detects the cycle, chooses one transaction as the victim, and rolls it back so the other can continue. The error returned to the application, ERROR: deadlock detected, confirms that a deadlock occurred, but it does not explain which operations were involved or why they were waiting on each other. That is usually where the real investigation starts. A…
B
A fast-growing AI-native SaaS team we worked with alongside Supabase was writing 1.8 TB of WAL a day. That number alone made the database look like the ceiling. When we broke it down, about 39% of that WAL was full-page-image overhead. It didn’t come from the application, the platform or the workload. It came from a five-minute checkpoint default.This post walks through why that happens, how to check whether it’s happening to you, and what to do about it. Everything here applies to PostgreSQL…
B
How a resumable parallel backfill, two disk-pressure incidents and a second look at the reconciliation query got tens of billions of rows across, with logical replication running the whole time. Key Takeaways A parallel backfill has to be stoppable. ID-range segments with per-batch checkpoints let workers be restarted, added or removed mid-run without copying a row twice or skipping one. An even split by ID is not an even split by rows. Bulk loading into a node whose WAL archiving is failing…
B
The cheapest way to cut your PostgreSQL cloud bill is to make the database do less work per transaction before you pay for a bigger instance. When we benchmarked this on AWS, tuning alone gave us 4 to 4.7 times more throughput on the same hardware and cut the cost per transaction by 75 to 78%. This post pulls together two of our webinars: Reducing Cloud Costs by Optimizing PostgreSQL (July 2024) and Capacity Planning and Selecting the Right Instance Size (February 2025). PostgreSQL has shipped…
B
A PostgreSQL DBA service is only as good as the worst night your database has. The sales deck won’t tell you how a provider behaves at 3 AM on a Sunday, but the right questions will. You’ll see these services under a lot of names: remote DBA, outsourced DBA, managed DBA services, PostgreSQL DBA support. At Stormatics we call it DBA as a Service. The idea is the same. Instead of hiring a full-time DBA, you get a team of PostgreSQL experts who run your databases under an SLA. I’ve spent most of…
B
Key Takeaways PostgreSQL can run a prepared statement with either a generic or a custom plan, and the choice affects query performance. A custom plan is created using the actual parameter value, so it can adapt to the data, but it costs planning time on every execution. A generic plan is reused across parameter values, which reduces planning overhead but cannot adapt when values return very different amounts of data. Data distribution is the main reason a prepared query is fast for some values…
B
How two small HAProxy health endpoints let a plain Layer 4 load balancer send writes to the PostgreSQL primary and reads to the replicas, with no floating IP and no single point of failure in the routing layer. Key Takeaways On AWS, a keepalived floating IP does not carry over cleanly because VPCs do not support VRRP multicast, so a Patroni cluster needs another way to tell the AWS NLB which node is the primary. An NLB works at Layer 4 and does not know which PostgreSQL node is the primary.…
B
Key Takeaways PostgreSQL VACUUM makes the space used by dead tuples reusable inside the table, but it does not normally shrink the table file. After VACUUM, new rows can be placed in freed locations, as the new row in lp 11 shows. VACUUM FULL rewrites the table into a new file and returns unused space to the operating system, but it holds an ACCESS EXCLUSIVE lock while it runs. Keep autovacuum enabled. We turned it off on bloat_demo and bloat_big only to keep the demo output predictable. On a…
B
PostgreSQL 14 receives its final minor release tomorrow, November 12, 2026. No new security or bug fixes ship for it after that. Your database keeps running, but every vulnerability found after that date stays open on your servers.PostgreSQL 15 follows on November 11, 2027. If you run either version in production, this post covers the three decisions that matter: which version to move to, which method to use, and how to make the switchover a non-event.Decision 1: the target versionEvery major…
B
Key TakeawaysA column’s data type affects table size, index size, how values are compared, and how efficiently queries run.Choose types by what the data means and its expected range, not by convenience or the smallest size.Use native types (numeric, date, timestamptz, boolean, uuid, jsonb) instead of storing everything as text.Larger types make larger indexes, which means more disk, I/O and cache pressure, and that only becomes visible at scale.Matching application parameter types to column…
B
PostgreSQL and NUMA, Part 4 of 4 This series covers the specifics of running PostgreSQL on large systems with many processors. My experience is that people spend months often learning the basics when confronted with the problem. This series tries to dispel these difficulties by providing a clear background into the topics in question. The hope is that future generations of database engineers and administrators don’t have to spend months figuring things out through trial and error. This article…
B
Key Takeaways A minor upgrade, such as 15.13 to 15.19, only replaces the binaries. The data directory stays as it is, so there is no pg_upgrade, dump and restore, or new cluster. The upgrade command takes seconds. The real risk is not having a tested plan for when the server doesn’t come back as expected. Before upgrading, read every release note in between, take and verify a backup, save the RPMs you are running, check for version locks and record a baseline. Rehearse the upgrade and the…
B
Key TakeawaysJIT compiles parts of a query into machine code at run time. It can help long-running, CPU-intensive queries, but the compilation itself takes time.jit = on does not mean every query uses JIT. PostgreSQL decides based on the query’s estimated cost and the jit_above_cost, jit_inline_above_cost and jit_optimize_above_cost thresholds.In the first test, a short join query took 320.230 ms with JIT and 1.972 ms without it.In the second test, a calculation-heavy query ran about 555 ms…
B
Key TakeawaysTable bloat is extra space left in a table when old row versions stay in the heap after updates or deletes.Under MVCC, an UPDATE creates a new row version instead of overwriting the old one, so other transactions keep a consistent view.Once no active transaction needs an old row version, it becomes a dead tuple. Its space stays in the table until VACUUM makes it reusable.The logical row count can stay the same while physical tuples grow. In the demo, 10 rows became 13 tuples after…
B
Most teams I work with have a backup dashboard, and most days it is green. The job ran; it finished; nothing failed. That green tick feels like safety, and it is the reason nobody thinks about backups again until the day they need one. Then something breaks, someone asks how long it will take to get the database back, and the room goes quiet. Nobody knows. The backups have been running for a year, and nobody has ever brought one back. I am writing this because that gap, the space between having…
B
A PostgreSQL superuser can read any file on the server, write to it, and run shell commands on the host. That is more than just a powerful database account. It is shell access.This is also why the role your application logs in with should almost never be a superuser. Most tools ask for it anyway, because it is the easy way to make setup “just work.” The problem is what else comes attached. Here is what superuser actually grants, why your application and your tooling do not need it, and how to…
B
Correction (6 November 2026): An earlier version of this post stated that these NUMA patches were committed to PostgreSQL 18. They have not been committed yet. PostgreSQL and NUMA, Part 3 of 4This series covers the specifics of running PostgreSQL on large systems with many processors. My experience is that people spend months often learning the basics when confronted with the problem. This series tries to dispel these difficulties by providing a clear background into the topics in question. The…
B
Key TakeawaysA write into compressed chunks triggers decompression. Its disk cost depends on how many compressed batches and chunks the write touches, not on how many rows change.Batch the backfill in windows no larger than one chunk interval, and give every statement both a start and an end time.After each batch, run VACUUM (ANALYZE), recompress the affected chunk, and check disk usage before starting the next batch.Keep timescaledb.max_tuples_decompressed_per_dml_transaction enabled, so an…
B
Key Takeaways Signal 1 (SIGHUP) normally tells PostgreSQL to reload its configuration. A log line saying a process was terminated by signal 1 means that process didn’t handle the signal and died from it.received SIGHUP, reloading configuration files is a harmless reload. server process (PID …) was terminated by signal 1: Hangup is a death report.When any child of the postmaster is killed by a signal, PostgreSQL drops every connection, resets shared memory, and replays WAL. The postmaster keeps…
B
How a risk-sequenced PostgreSQL logical replication migration, a purpose-built change-capture table, and a monitoring script keep source and target in sync as the project moves toward cutover.Key TakeawaysProduction data is moving from Patroni-managed PostgreSQL clusters to clusters managed by EDB Failover Manager (EFM), using PostgreSQL logical replication and sequenced by risk: the parent table first, then the child tables that reference it through foreign keys.We identified a silent…
B
What a 4 TiB Azure Disk Taught Us about Slow ReadsOne of our customers spent most of a week tuning PostgreSQL to fix slow reads. They worked through shared_buffers, effective_cache_size, work_mem, and the rest of the checklist, and set all of them sensibly. The reads stayed slow. And the reason had nothing to do with any of those settings. Their data disk had reached 4 TiB, and the moment it did, Azure switched off the host cache sitting in front of it.That is the frustrating thing about…
B
How real data, not convention, shaped four different PostgreSQL partitioning strategies for the largest tables in a production database, and the two bugs we caught before they ever reached production. Key TakeawaysDesigned partitioning strategies for the four largest tables in a production database schema, deliberately not using the same approach for all four.Foreign key dependency analysis surfaced 35 and 59 dependent relationships on two of the four tables, a hard structural constraint that…
B
Key takeawaysSpeed is the wrong finish line. If moving the date by a week buys you a clean cutover, move it.Define success in numbers first: zero rows lost, a recovery time objective, a signed-off cutover window. Let the downtime budget pick your method, dump and restore or logical replication.Validate before, during, and after, using row counts plus checksums and business totals. Counts alone can be right while the contents are wrong.Rehearse against a production copy and time it. That number…
B
Key takeawaysA routine OS patch can take Postgres offline even when Postgres itself was never touched. Here’s what rolling OS patching on a proper HA cluster changes:OS-level patches (kernel, glibc, container runtime, storage driver) can take Postgres down even though Postgres was never touched.The usual fix, a maintenance window, breaks down once the business runs 24/7 or compliance wants patches applied fast.In a properly built Patroni HA cluster, OS patching is rolling and one node at a…
B
On August 13, 2026, PostgreSQL shipped its biggest security release ever: 28 CVEs closed in a single day. The old record was 11.The community has done its job, a phenomenal one at that! If you run PostgreSQL for critical workloads in production, the number you should focus on is how long it takes to get a fix from “released” to “running in production.” Call it your patch latency. That’s what this post is about.The Count Went Up Because the Attention Went UpHere is the trend in plain numbers.…
B
A small setting most teams either ignore or guess at. Here’s the quick version, then the full breakdown.Key TakeawaysFillfactor sets how full Postgres packs each table page on write, leaving the rest as free space for future updates to land in-place (HOT updates), which cuts WAL and I/O.Starting formula: 100 − (average row size ÷ 8,192 × 100). Get average row size from pg_relation_size() and n_live_tup, run after a recent ANALYZE.For heavily updated tables, go lower than the starting number to…