Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Your company has 300 PostgreSQL databases on versions 11 to 17, several past end of life. How do you build an upgrade programme that stops this from happening again?

I would start with an inventory of all 300 databases with version, size, owner and end-of-life date, then set a policy that every database stays within one major version of the latest, with a yearly upgrade window that follows PostgreSQL's release cycle. Platform tooling must make upgrades routine, with runbooks for pg_upgrade and logical replication, test environments and plan regression checks, and the work must be funded as planned maintenance with team time, with the risk reported to leadership. Managed services are an option where their automation is worth the cost and lost control.

Why this question is asked

Databases past end of life are rarely the result of one bad decision. They come from years of upgrades that were always less urgent than the next feature, done by volunteers when someone had time. Each PostgreSQL major version gets five years of fixes, so with 300 databases and no process, several fall out of support every year. Interviewers ask this leadership question to see whether we can fix the backlog and, more importantly, change the system that created it. In this answer, we will look at why upgrades get skipped, build the inventory, set a policy, make upgrades cheap with tooling, secure funding, decide where managed services help, and prioritise the 300.

1Why Upgrades Keep Getting Skipped

PostgreSQL releases one major version a year and supports each one for five years. After that, there are no more security fixes or bug fixes. On paper that is plenty of time. In practice, an upgrade has a visible cost, a project with risk and downtime, and an invisible benefit, avoiding problems that have not happened yet. Every quarter it loses to feature work, until a version is past end of life and the upgrade has become a two-version jump with a deadline.

So the root cause is not technical. It is that upgrades have no owner, no budget and no routine. A good programme fixes those three things, and the technical runbooks follow.

2Starting With an Inventory

We cannot manage what we cannot see. The first step is an inventory, ideally generated automatically by querying every cluster, with one row per database: version, size, owning team, the services that use it, high availability setup, extensions, and the end-of-life date of its version. Many organisations discover databases nobody remembers owning, and finding an owner for each is part of the work.

SQL
SELECT current_setting('server_version') AS version,
pg_size_pretty(sum(pg_database_size(datname))) AS size
FROM pg_database;
-- 11.22 | 1.4 TB (version 11: out of support since November 2023)

From the inventory we can draw the picture leadership needs: for example, 41 databases past end of life, 60 reaching it within a year, and the rest current.

3A Policy That Keeps Versions Current

The policy is simple to state: every production database runs a supported major version, and within one version of the latest (N-1). Because PostgreSQL releases each autumn, we set a yearly upgrade window, for example the first quarter after a release once the first minor fixes are out, in which every team moves its databases forward. A database that is two versions behind is an exception that needs a written reason and a date.

The policy turns an open-ended question, when should we upgrade, into a routine with a calendar. It also keeps every upgrade a one-version step, which is smaller and better tested than a jump across four versions.

Version status in the inventory
StatusRuleAction
currentlatest or N-1upgrade in the yearly window
behindN-2 or older, still supportedexception with a date
near end of lifesupport ends within 12 monthsscheduled this quarter
end of lifeno more fixestop priority, risk reported to leadership

4Making Upgrades Routine With Platform Tooling

A policy only works if upgrades are cheap. The platform team builds the tooling that makes them so: tested runbooks and automation for pg_upgrade with --link for databases that can take a few minutes of downtime, and for logical replication with a switchover for those that cannot; ready-made test environments where a team can restore a copy of its database on the new version; and plan regression checks that run the team's most important queries on both versions and flag ones that got slower.

The goal is that an upgrade for a typical database is a ticket, not a project. When the tenth upgrade uses the same scripts as the first, each one gets faster and safer, and the remaining effort is the application team's testing.

Step throughThe yearly upgrade cycle
  1. New major version releasedwait for the first minor fixes
  2. Platform team validates tooling and extensionsrunbooks, images, checks
  3. Teams test on the new versionplan regression checks
  4. Upgrade in the windowpg_upgrade or logical replication
  5. Inventory updated, exceptions reviewedreport to leadership

5 steps in order. Play them, or step through them one at a time.

5Funding and Reporting the Risk

Upgrades need time, so they need a budget. We treat them as planned maintenance, like certificate renewals or dependency updates, with a fixed share of each team's capacity in the upgrade window, and platform team capacity for tooling. That is a conversation with engineering leadership, and it goes better with numbers: how many databases are out of support, what security fixes they are missing, and what an incident on an unsupported version would cost.

We report the inventory status every quarter, in the same place leadership sees other risks. Out-of-support databases are a risk the business is accepting, and making that visible is part of the job, not an escalation. It also gives teams cover: when the upgrade is in the plan, nobody has to argue it against features again.

6Where Managed Services Fit

Managed PostgreSQL services apply minor versions automatically and offer tooling for major upgrades, which removes a lot of routine work. For many small and medium databases that is worth the price. The trade-offs are cost at scale, less control over timing and configuration, the provider's own version timelines, which may differ from the community's, and extension support. So we weigh it per class of database, for example moving the many small internal databases to a managed service while keeping a few large, specialised ones self-managed.

7Follow-up questions

How would you prioritise among the 300?

By risk first and effort second. Databases past end of life come first, and among them the ones with the most exposure: internet-facing services, sensitive data, or regulatory requirements. Then those reaching end of life soonest. Within each group, we start with a few simple, low-risk databases to prove the tooling, then take on the large and complex ones with the experience gained. Databases nobody owns get an owner or a decommissioning decision before anything else.

What if a team refuses to upgrade because their application is fragile?

We find out what makes it fragile, usually a lack of tests or an old driver, and help with that, for example by providing the test environment and plan comparisons. If they still cannot upgrade, the exception goes to leadership with the risk stated, so the decision is made on purpose by someone who owns it.

Should you skip versions to catch up faster?

For the backlog, yes, pg_upgrade and logical replication can jump several versions at once, so an 11 database can go straight to 17. The policy afterwards keeps each later upgrade to one version.

8Conclusion

In this answer, we saw that databases fall out of support because upgrades have no owner, budget or routine. We built a programme on an inventory with versions, sizes, owners and end-of-life dates, a policy of staying within N-1 with a yearly window aligned to PostgreSQL's release cycle and its five years of support, platform tooling that makes pg_upgrade and logical replication upgrades routine, funding as planned maintenance with risk reported to leadership, and a per-class decision about managed services. Prioritisation goes by risk first and effort second.

What to say in the interviewAbout 80 seconds aloud

Open with

I would treat this as a process problem, not a technical one. Upgrades get skipped because they have no owner, no budget and no routine. First, an inventory generated from the clusters: version, size, owner, services and end-of-life date for all 300, knowing that each major version is supported for five years.

Then, if they want more

That shows leadership exactly how many are out of support and how many are close. Second, a policy: every production database within one major version of the latest, with a yearly upgrade window after each autumn release, and anything further behind is an exception with a reason and a date.

Third, platform tooling so an upgrade is a ticket, not a project: runbooks and automation for pg_upgrade with --link and for logical replication switchovers, test environments, and plan regression checks on the team's key queries.

Fourth, funding: upgrades are planned maintenance with reserved team time, and I report the out-of-support count and its risk every quarter so the decision is visible. I would also look at managed services for the many small databases, weighing cost and control.

For the 300, I would prioritise by risk: out of support and exposed first, then soonest end of life, starting with a few simple ones to prove the tooling.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
PostgreSQL documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your company has 300 PostgreSQL databases on versions 11 to 17, several past end of...": https://scrivio-interview-library.netlify.app/databases/postgresql/744c572882/