Upgrade to PostgreSQL 18.7 only after you inventory installed C-language extensions, check their maintainers’ guidance, and rehearse any required rebuild or source changes. Do not rebuild every extension by default, and do not disable composite_type_mismatch as a shortcut: PostgreSQL warns that disabling the check creates a security risk in its 18.7 release notes.
Who this is for: You run PostgreSQL 18 and need to plan the 18.7 update as a DBA, backend engineer, platform operator, or SaaS technical lead.
The immediate task: identify which installed extensions contain C code, establish a recoverable baseline, and test the update before your production maintenance window.
Last updated November 13, 2026. Version and behavior details were checked against the PostgreSQL 18.7 release notes and the official release announcement. Check extension-specific guidance again before deployment; maintainers may publish compatibility information separately.
Step 1: Establish what the 18.7 change means
The key distinction is between updating PostgreSQL itself, rebuilding C code, and updating an extension’s SQL objects. These are related tasks, but they are not interchangeable.
PostgreSQL’s 18.7 release notes describe a change involving checks for mismatched composite types. The notes say that rebuilding C-language extensions is needed for full protection and that some extensions may require source changes as well. They also warn that disabling the composite_type_mismatch check has security implications. This is a reason to assess your installed C code carefully, not evidence that every extension is affected.
A C-language extension can install functions that load compiled shared libraries. That makes the extension’s actual code and build relevant to the change. An extension that only supplies SQL objects is a different case. It may need an extension SQL update for its own reasons, but that does not make it a C extension that must be rebuilt for this check.
Keep three actions separate in your change record:
- PostgreSQL minor update: update the server installation to 18.7 and follow your platform’s service-restart procedure. PostgreSQL documents that an update within a major version does not require a dump and restore; confirm the applicable instructions in the official release announcement.
- C extension rebuild: compile extension code against the appropriate PostgreSQL server development files and install the resulting library. Use the extension maintainer’s instructions and PostgreSQL’s PGXS build documentation where applicable.
- Extension SQL update: run
ALTER EXTENSION ... UPDATEonly when the extension provides an update path and the maintainer’s instructions call for it. The command updates extension objects; it is not a compiler. See the PostgreSQLALTER EXTENSIONdocumentation.
Do not treat “the extension updated successfully” as proof that its C library was rebuilt. Record the library build and SQL extension version as separate facts.
Step 2: Inventory installed extensions and C functions
Start with the live database, not just a package directory or a list copied from a previous change. Run the inventory against each database that may use an extension.
List extensions registered in the current database:
SELECT extname, extversion, extnamespace::regnamespace AS schema
FROM pg_extension
ORDER BY extname;
The pg_extension catalog documentation explains what this catalog records. It shows extensions registered in that database. It does not, by itself, confirm that the server has the correct shared library installed or that the library was rebuilt for your target update.
Next, identify functions declared in the C language and note their library and entry-point information:
SELECT p.oid::regprocedure AS function_name,
p.probin AS library,
p.prosrc AS entry_point
FROM pg_proc AS p
JOIN pg_language AS l ON l.oid = p.prolang
WHERE l.lanname = 'c'
ORDER BY p.probin, p.oid::regprocedure::text;
The pg_proc documentation describes these function properties. To connect C functions to an installed extension where catalog dependencies exist, use a query such as:
SELECT e.extname,
e.extversion,
p.oid::regprocedure AS function_name,
p.probin AS library
FROM pg_depend AS d
JOIN pg_extension AS e
ON d.refclassid = 'pg_extension'::regclass
AND d.refobjid = e.oid
JOIN pg_proc AS p
ON d.classid = 'pg_proc'::regclass
AND d.objid = p.oid
JOIN pg_language AS l ON l.oid = p.prolang
WHERE d.deptype = 'e'
AND l.lanname = 'c'
ORDER BY e.extname, p.oid::regprocedure::text;
Treat this as an inventory aid, not a complete compatibility verdict. Also check locally created C functions, libraries loaded directly by application or administrative code, and extensions that are not packaged as PostgreSQL extensions. Review your deployment manifests, package manager records, build scripts, and configuration for those cases.
Then check the server installation itself:
- Confirm that each library named in
probinexists at the expected location and is owned by the intended package or build process. - Record the installed extension package version and its source. “Available” in a control-file list does not prove that the binary library is present, current, or safe for this update.
- Ask whether each extension uses or returns composite types, and inspect custom C functions that handle such values. Record anything you cannot verify as an upgrade blocker until its maintainer or source code provides an answer.
Step 3: Choose rebuild, source change, or a pause
Use a decision record for each C extension rather than applying one blanket rule.
| Option | Use it when | What to verify before production |
|---|---|---|
| Rebuild the extension | The extension contains C code and its maintainer supports a rebuild for the target PostgreSQL update. | Build from the documented source and toolchain; verify the installed library path, package or artifact version, and function loading. |
| Rebuild and modify source | The maintainer’s guidance or your review identifies code changes needed for the composite-type checks. | Apply the documented fix, build the revised code, and test functions that handle composite values. Record the source revision. |
| Defer the update | A critical extension has no confirmed compatible build, the source requirements are unclear, or the rehearsal fails. | Keep the issue visible, assign an owner, and define what evidence will clear the blocker. Do not silently accept an unknown library. |
| Consider a check-setting change only after review | A specific operational reason remains after assessing rebuild and source options. | Review the security implications with the responsible technical owner. Do not present disabling the check as the routine or risk-free path. |
The option depends on the extension implementation and its maintainer’s guidance. A SQL-only extension is not automatically in the C-rebuild category. Conversely, a custom C function may need assessment even if it does not appear under an extension name in pg_extension.
Confirm whether the extension project has published an update, build notes, or source patch for PostgreSQL 18.7. If the project does not state compatibility, do not infer it from a successful compile alone. Compilation confirms that a build completed; it does not establish that the code handles your database’s composite-type use safely.
Step 4: Prepare backups, artifacts, and rollback
Before changing the server, define what you would restore and where the recovery material lives. PostgreSQL’s backup documentation describes backup approaches and recovery considerations. Follow a method appropriate to your deployment, and verify that its output is usable.
For this update, retain a recoverable baseline that includes:
- A backup stored outside the database server, plus the instructions and credentials needed to restore it.
- The current PostgreSQL package or installation details, configuration, extension inventory, and installed extension versions.
- The extension source revision or package artifact used in production, plus the build instructions and any local patches.
- A written update and rollback procedure, including who approves the change and how you will verify service recovery.
Do not treat disk mirroring or database replication as a backup. They can help with availability or redundancy, but they do not replace an independently recoverable copy. Before the maintenance window, perform a restore rehearsal from the external backup. A backup file that has never been restored is not sufficient evidence that rollback is ready.
Separate extension rollback from server rollback. Restoring a database backup may recover database contents, but it does not automatically restore an old shared library or recreate the previous operating system package state. Keep the extension artifacts and server installation plan available, and test the complete recovery path in the rehearsal environment.
Step 5: Rehearse the update on an isolated copy
Use a test environment that resembles production in its PostgreSQL configuration, extension inventory, and application use. Restore a representative copy, apply the PostgreSQL update, then install or rebuild only the extensions identified by your assessment.
Work through the rehearsal in a recorded sequence:
- Capture the starting PostgreSQL version, extension catalog output, library paths, and relevant configuration.
- Apply the server update using the same package or deployment process planned for production.
- Install the documented extension builds. Apply source changes where the extension guidance requires them.
- Start the server and check logs for missing libraries, load failures, warnings, or changed behavior.
- Call functions that use composite types, then run application paths that depend on those functions. Include background jobs and administrative scripts, not just the application’s simplest read query.
- Apply extension SQL updates only when required, and verify the resulting extension version in each database.
Record exact failures and the conditions that caused them. If a C function fails only when given a particular composite value, that is important compatibility evidence; a clean server start alone is not enough.
Do not use the rehearsal to claim a performance improvement or predict production downtime. No site-specific test results are available here. If performance is part of your acceptance criteria, define a workload that reflects your application, measure it before and after in the same environment, and report the test conditions and observed results separately from the compatibility decision.
Step 6: Run the production change and close the record
Proceed only when critical extensions have a confirmed build or documented source fix, the rehearsal passes the application checks that matter to you, and the external backup has passed a restore test. If any critical extension remains unverified, defer the update or make a formally reviewed risk decision. Do not make an untested security-setting change simply to get past the blocker.
During the maintenance window, follow the rehearsed deployment order. After the update:
- Confirm the running PostgreSQL version and review server logs.
- Confirm that required shared libraries load and that the intended extension versions appear in each database.
- Run the same composite-type function checks and critical application paths used in rehearsal.
- Review monitoring and application errors before declaring the change complete.
- Save the version, extension inventory, build sources, test results, outstanding issues, and rollback outcome in the maintenance record.
This record makes the next PostgreSQL update easier to assess. It also prevents a future operator from assuming that an extension was rebuilt merely because an SQL extension version changed.
Common questions
Does every PostgreSQL extension need a rebuild?
No. The release guidance calls out C-language extensions for full protection, with source changes needed for some extensions. That does not establish that every installed extension is affected. Classify each extension by implementation, check its maintainer’s instructions, and separately assess custom C functions that may not be registered as an extension.
Is ALTER EXTENSION UPDATE the same as recompiling?
No. ALTER EXTENSION ... UPDATE applies an extension’s SQL update script when one is available. Recompilation builds C code into a shared library. Your update record should show these as separate actions, including the library artifact and source revision for any rebuild.
Is it safe to disable composite_type_mismatch?
Do not treat that setting as a routine compatibility workaround. PostgreSQL’s 18.7 release notes warn that disabling the check has security implications. First determine whether your installed C code needs a rebuild or source change. If you still consider changing the setting, document the reason and have the risk explicitly reviewed.
What should pass before the PostgreSQL 18.7 update goes live?
Your rehearsal should show that the server starts, required extension libraries load, relevant composite-type functions behave as expected, and critical application paths work. You should also confirm that an external backup can be restored and that your rollback steps include the server packages and extension artifacts—not only database data.
Choose infrastructure for the rehearsal, not as a substitute for extension work
If your current test environment is a shared cloud instance, account for possible neighbor contention, resource limits, and storage choices that may not match the production database. An independent server gives you a dedicated machine and direct-connected storage, but it does not validate extension code, provide managed PostgreSQL operations, or replace your own backup and rollback process.
AmdSrv’s published server options include an EPYC 7543P with 32 cores and 64 threads, 128 GB or 256 GB of ECC memory, and two directly connected 1 TB NVMe drives; check the current machine specifications before choosing a rehearsal host. The site lists monthly, quarterly, half-year, and annual billing; confirm current terms on the price list. You would manage the PostgreSQL installation and extension builds yourself.
For a PostgreSQL 18.7 rehearsal, first match the operating system and resources to your workload, then keep the backup outside the database machine. If a dedicated host fits your testing or long-running database needs, it can provide a more consistent hardware baseline than a shared instance. If you only need a short-lived test or have a light workload, a smaller shared environment may be the more economical choice.
Frequently asked questions
Which PostgreSQL extensions should I rebuild for the 18.7 update?
Start with extensions that install C-language functions, including custom libraries and third-party modules. PostgreSQL's release guidance calls for rebuilding C extensions for full protection, and some may also need source changes. Do not assume that every extension, or every SQL-only extension, needs rebuilding. Confirm each project's 18.7 guidance and test the actual installed build before production.
How can I tell whether a PostgreSQL C extension needs a rebuild?
Use the catalogs to list installed extensions and functions declared in the C language, then inspect the shared-library paths and package versions on the server. Compare those details with the extension maintainer's 18.7 compatibility notes and build instructions. A directory name or an available extension control file alone does not prove that the loaded library was rebuilt or is compatible.
Can I turn off composite_type_mismatch to avoid rebuilding?
Do not make that the default workaround. The PostgreSQL 18.7 release notes warn that disabling composite_type_mismatch carries a security risk. Treat it as a risk decision that requires a specific, reviewed reason, not as a substitute for rebuilding affected C code or applying required source changes. Prefer a compatible extension build and a rehearsed update.
How should I test extension compatibility before PostgreSQL 18.7?
Restore a recent backup into an isolated environment that matches production, apply the PostgreSQL update, and install or rebuild the extensions identified by your inventory. Test extension loading, functions that use composite types, and your application's critical database paths. Record errors and rollback steps. Verify that the external backup can actually be restored before scheduling the production change.
Further reading
AmdSrv Dedicated Server with AMD EPYC 7543P, from $458/month
