Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

Extensions are one reason PostgreSQL won wide adoption, but every extension you allow ties you to a version, a vendor or a managed provider. How would you govern extensions across the company?

I would govern extensions with an approved list where every extension has an owner and has been reviewed for maintenance, licence, security record and support on every platform we run, from our own servers to each cloud. Built-in features come first, niche extensions need a written exit plan, and extension versions are part of every major upgrade plan, because C extensions run inside the database server and a bug there can take the whole cluster down.

Why this question is asked

Extensions are a big part of why PostgreSQL is so useful: PostGIS, pgvector, pg_stat_statements and many others turn a general database into exactly the tool a team needs. But each one is a dependency that lives inside the database, and it decides which versions we can upgrade to, which managed providers we can use, and how risky a crash is. Interviewers ask this at a senior level because the answer shows whether we can keep teams productive while protecting the estate from lock-in nobody chose on purpose. In this answer, we will recap what an extension really is, look at why it creates long-term ties, and then build a governance model: the approved list, the review, the exit plan, and how extensions fit into upgrades.

1A Quick Recap: What an Extension Is

An extension is a package of SQL objects, and often compiled C code, that we install into a database with CREATE EXTENSION. It can add data types, functions, index methods, background workers and hooks into the planner or executor. PostgreSQL ships some extensions in its contrib modules, such as pg_stat_statements, pg_trgm and btree_gist, and many more come from outside the project.

The important detail is where the code runs. An extension written in C is loaded into the PostgreSQL server process itself. It is not a separate service with its own failure boundary. If it has a memory bug, it can crash the backend, and a crash makes the postmaster restart every connection and run crash recovery. A subtle bug in an index method can even write bad data that corrupts an index or a table. So allowing an extension is closer to adding code to the database engine than to adding a library to an application.

2Why Every Extension Creates a Tie

Each extension ties us in three ways. The first is the version: an extension build supports a set of PostgreSQL major versions, so if the maintainers are slow to support PostgreSQL 18, our upgrade waits for them. The second is the platform: managed services such as RDS, Cloud SQL or Azure only allow the extensions they have packaged, often at their own versions, so an extension we rely on can stop us from moving providers. The third is the vendor: some extensions are maintained by one company, sometimes under a licence that restricts how they can be offered as a service, and their future follows that company's priorities.

There is also a good side to this, and it explains why we should not simply ban extensions. The extension API is what allowed PostGIS, Citus, TimescaleDB and pgvector to grow outside the core. The core team can stay conservative about new features, and the ecosystem moves fast around it. Our governance should keep that benefit while making the costs visible before a team depends on them.

3Building the Approved List

The centre of the model is an approved list, kept in version control, with one row per extension. Each row names an owning team, the allowed versions, the platforms where it is available, and a status such as approved, approved with an exit plan, or deprecated. The database platform image or the managed parameter group only allows extensions on that list, so the list is enforced, not just written down.

Before an extension joins the list, we review it on four questions. Is it actively maintained, with releases for recent PostgreSQL versions? Is the licence acceptable for how we use it, including in a hosted product? What is its security record, and does it need superuser or untrusted language access? And is it supported on every platform we run, our own servers and each cloud provider, at a version we can live with? An extension that fails the platform question is a real cost: it means that database can never move to that provider without a migration.

Extension review: example outcomes
ExtensionWhere it runsDecision
pg_stat_statementscontrib, every providerapproved, enabled everywhere
pgvectorwidely packaged by providersapproved, version tracked per upgrade
PostGISwidely packaged, large C codebaseapproved, owner team tests each upgrade
one-maintainer C extensionself-managed onlyapproved only with an exit plan
extension needing superuser on managednot available on managedrejected unless a business case exists
The decision depends on maintenance, platform support and how hard it would be to leave.

The review does not need to be heavy. For a well-known contrib module it takes minutes. The time goes into the niche extensions, which is exactly where the risk is.

4Prefer Built-in Features and Require an Exit Plan

The cheapest extension is the one we do not need. Many features that used to need an extension are now in core: declarative partitioning replaced much of what older partitioning extensions did, and generated columns and JSON path queries cover cases that once needed custom functions. So the first question in a request is whether a built-in feature does the job well enough.

When a team needs a niche extension, we ask for an exit plan before approval. The plan answers a few plain questions: which tables and queries depend on it, what we would use instead, and roughly how long the move would take. For example, a team using a small fuzzy-matching extension might write that pg_trgm, which is in contrib, covers 90 percent of their queries and that the move would take two weeks. That one paragraph turns a hidden dependency into a known, sized one.

5Extensions and Major Upgrades

Extensions are often what makes a major upgrade fail late. pg_upgrade needs the same extensions installed in the new cluster, and the extension's own objects may need updating after the move. So extension versions belong in the upgrade plan from the start, checked against the target version before the project is scheduled.

SQL
-- What is installed, and is a newer version available in the new binaries?
SELECT name, installed_version, default_version
FROM pg_available_extensions
WHERE installed_version IS NOT NULL;
-- postgis | 3.4.2 | 3.5.0 (an update is available)
ALTER EXTENSION postgis UPDATE; -- moves to default_version
SELECT extversion FROM pg_extension WHERE extname = 'postgis'; -- 3.5.0
Step throughLifecycle of an extension request
  1. Is a built-in feature good enough?
    YesUse the built-in featureNoReview the extension
  2. Maintained, licence ok, on all platforms?
    YesAdd to the approved list with an ownerNoRequire an exit plan or reject
  3. Track the version per clusterinventory from pg_extension
  4. Test on each new major versionowner runs compatibility tests
  5. Still maintained and needed?
    YesKeep itNoDeprecate and follow the exit plan

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

The owning team runs its compatibility tests on the target version before the upgrade window: its real queries, its index builds and its restores. If an extension blocks the upgrade, we see it months ahead, not on the night.

6Making It Work Across Teams

Governance fails when it is only a gate. So the platform team also does the useful work: it publishes the list with examples of when to use each extension, keeps an inventory of which cluster uses which extension at which version, and reports deprecated or unmaintained extensions to their owners each quarter. A team should be able to get a common extension approved in a day. If the process is slow, teams find ways around it, and we lose the visibility the list was meant to give.

7Follow-up questions

How would you handle an extension that a managed provider does not support?

First we check whether a built-in feature or a supported extension covers the need. If the extension is truly needed, we accept that the database stays self-managed or on a provider that supports it, record that decision with the reason, and add it to the exit plan. The worst outcome is discovering the gap during a migration, so the review asks the platform question up front.

Why is a C extension riskier than a SQL-only one?

A SQL or PL/pgSQL extension runs through the normal executor and its mistakes are ordinary errors. A C extension runs inside the server process with full access to memory, so a bug can crash the backend, force crash recovery for all connections, or write corrupt pages. That is why C extensions get a stricter review and an owner who tests them on every upgrade.

Should we ever remove an approved extension?

Yes. When an extension stops getting releases for new PostgreSQL versions, or a built-in feature replaces it, we mark it deprecated, tell the owners of every cluster that uses it, and follow its exit plan before it blocks an upgrade.

8Conclusion

In this answer, we saw that extensions are code running inside the database server, and that each one ties us to versions, providers and sometimes a vendor. We govern them with an approved list that names owners and records maintenance, licence, security and platform support; we prefer built-in features, require an exit plan for niche extensions, and treat extension versions and ALTER EXTENSION UPDATE as part of every major upgrade. Done well, this keeps the benefit of the ecosystem that grew around PostgreSQL without letting dependencies pile up unseen.

What to say in the interviewAbout 90 seconds aloud

Open with

I would treat extensions as code that runs inside the database, because a C extension is loaded into the server process and a bug can crash or even corrupt the cluster.

Then, if they want more

So I would keep an approved list in version control, enforced by the platform images and parameter groups, where each extension has an owning team, allowed versions and the platforms it runs on.

Before approval we check four things: is it maintained, is the licence fine for how we use it, what is its security record, and is it available on every platform we run, self-managed and each cloud provider.

I would always ask first whether a built-in feature is good enough, and for niche extensions I would require a short exit plan that says what we would move to and how long it would take.

Extension versions go into major upgrade planning: we check them against the target version early, run ALTER EXTENSION UPDATE after the upgrade, and the owners run compatibility tests. I would not ban extensions, because the extension API is why PostGIS, Citus, TimescaleDB and pgvector could grow outside a conservative core, and that is a real strength.

The goal is that every dependency is chosen on purpose and visible, and that the process is fast enough that teams use it instead of going around it.

About this answer

Last updated
12 November 2026
Versions it names
PostgreSQL 18
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 "Extensions are one reason PostgreSQL won wide adoption, but every extension you allow...": https://scrivio-interview-library.netlify.app/databases/postgresql/bd71dbc072/