Press "Enter" to skip to content

Category: Administration

ALTER TABLE and Partitioned Tables in PostgreSQL

Chao Li classifies a series of commands:

Does an operation propagate to partitions? Does it affect future partitions? Does ONLY do what it claims? Why do some commands work on parents but not on partitions—or vice versa?

Today, PostgreSQL documentation describes individual ALTER TABLE sub-commands well, but it rarely explains their interaction with partitioned tables as a whole. As a result, users often discover the real behavior only through trial and error.

This post summarizes a systematic investigation of ALTER TABLE behavior on partitioned tables, turning scattered rules into a consistent classification model.

Click through for 15 buckets of commands relating to ALTER TABLE in PostgreSQL and see how they handle dealing with partitioned tables.

Leave a Comment

Running PostgreSQL on Kubernetes

Umair Shahid digs into the arguments for and against:

“Should PostgreSQL run on Kubernetes too?”

The worst answers are the confident ones:

  • “Yes, because everything else is on Kubernetes.”
  • “No, because databases are special.”

Both are lazy. The right answer depends on what you’re optimizing for: delivery velocity, platform consistency, latency predictability, operational risk, compliance constraints, and, most importantly, who is on-call when things go sideways.

Click through for a detailed analysis. It’s a similar story in SQL Server:

Leave a Comment

Dealing with a Full Transaction Log

Rebecca Lewis performs some troubleshooting:

It’s 2am. Your phone wakes you. Rub your eyes, check your email, and there it is:

Error: 9002, Severity: 17, State: 4
The transaction log for database 'trading' is full due to 'LOG_BACKUP'.

The database is still online. Looks ok. You can read from it. But every INSERT, UPDATE, and DELETE fails. Production night-trading is effectively down.

The good news: It’s fixable — but, that fix depends entirely on what’s preventing log truncation.

Click through for a choose-your-own-adventure story.

Leave a Comment

Thoughts on the Death of the DBA

Rebecca Lewis presses X to doubt:

Every few years, something comes along that’s definitively, no-questions-asked going to replace us.

Let’s review the historical record.

Rebecca points out a half-dozen instances in which people have decried the end of the DBA role, and yet it’s still there somehow… And honestly, you could probably find a half-dozen more examples without searching too hard, like how SQL Server 2000 was going to render DBAs obsolete because of its self-management capabilities. Which, admittedly, is very similar to the 1996 Oracle announcement.

Leave a Comment

IOPS Slider in Azure SQL Managed Instance Next-Gen

John Morehouse cranks that slider to the right:

If you’ve used Azure SQL Managed Instance General Purpose, you know the drill: to boost memory or I/O, you had to scale the whole instance, paying for extra CPU you might not need—and hoping the upgrade fixed the bottleneck.

It worked but wasn’t elegant and could be slow or awkward. Scaling sometimes took hours when time was of the essence.

The Next-Gen Azure SQL Managed Instance marks a major shift from the old model. It was way overdue.

The downside is that there’s still a per-CPU hard cap on IOPS and it’s low. Granted, it’s only about two orders of magnitude lower than what I’d expect from a decent on-premises solution, but that’s still enough to limit severely my ability to recommend SQL Managed Instance to anybody.

Leave a Comment

Tracking Database File Sizes via Powershell

Kyle Burwell wants to know how big the databases are:

Database files (mdf, nds, ldfs, etc.) can get out of hand quickly and easily, leading to issues down the road. This can be due to improper planning, large data loads, and bad code run in production, just to list a few. As unglamorous as disk space monitoring is, we need to do our part as DBAs. This post is a quick guide on how to track database file sizes with PowerShell.

Read on for a few scripts to perform the task.

Comments closed

Sending Messages from SQL Server 2025 to Slack

Aaron Bertrand fires off a message:

In an earlier tip, A history of accessing REST APIs and web pages from SQL Server, I talked about reaching out to external endpoints from SQL Server, including the new sys.sp_invoke_external_rest_endpoint procedure that hit the on-premises editions in SQL Server 2025. This seemed like an ideal use case to enhance our current solution for sending a message to Slack: using xp_cmdshell to call a PowerShell script that calls Invoke-RestMethod. In this tip, I’ll describe how we changed our implementation and why it is a marked improvement for us.

When I did this same thing, I ended up using CLR, as the customer I did it for used SQL Server on Azure VMs and not Azure SQL Database.

Comments closed

Postgres Index Corruption after an OS Upgrade

Laurenz Albe has me concerned:

Most major Linux distributions have upgraded to the GNU C library version 2.28 or later. Therefore, there is a growing awareness that an operating system upgrade can lead to index corruption. However, rebuilding all your indexes can slow down the upgrade process considerably. In this article, I want to discuss how you can avoid rebuilding more indexes than necessary.

Read the whole thing if you are a Postgres DBA.

Comments closed

What VACUUM Really Does in Postgres

Radim Marek explains:

There is common misconception that troubles most developers using PostgreSQL: tune VACUUM or run VACUUM, and your database will stay healthy. Dead tuples will get cleaned up. Transaction IDs recycled. Space reclaimed. Your database will live happily ever after.

But there are couple of dirty “secrets” people are not aware of. First of them being VACUUM is lying to you about your indexes.

Click through to learn more.

Comments closed