PostgreSQL 17 to 18 upgrade

A planned PostgreSQL 17 to 18 upgrade depends on checking data checksums, MD5 roles, inheritance queries and generated columns before cutover. This page covers what changes, how to sequence the work and what drives effort.

On this page

PostgreSQL 17 to 18 upgrade: why and when to move

If you run PostgreSQL 17 in infrastructure you control, the move to PostgreSQL 18 is a planned major upgrade, not an urgent patch. PostgreSQL 17 is supported until November 8, 2029, and PostgreSQL 18, first released September 25, 2025, is supported until November 14, 2030. That gives you a long runway, so the decision is about timing against your own change calendar, your extension list and your downtime budget, not about a looming end of life. The move itself is a major upgrade, which means the on-disk format changes and you must use pg_upgrade, a dump and restore, or logical replication. Minor releases only swap binaries, so they cannot carry you to 18.

Choose the method before you pick the date. Logical replication works between different major versions and can cut over in only several seconds of downtime, according to the PostgreSQL documentation, but it requires you to plan replica identity, sequences and schema changes in advance. The pg_upgrade route is simpler to repeat and keeps planner statistics across the upgrade in PostgreSQL 18, but it depends on binaries and extensions that match on both sides. Confirm with your own team which downtime window the business will accept, and which rollback path each method leaves you, before you commit to a schedule.

Two questions decide whether 18 is the right target now. First, do your applications rely on behavior that PostgreSQL 18 changed, such as MD5 password authentication, VACUUM and ANALYZE scope, or generated columns? Second, can your extensions and drivers run on 18 in your own environment? Confirm the second point with each extension vendor and your driver maintainers, because the supported versions are not something this page can assert for you. Your answers set the scope of testing, and they should appear in the written plan the upgrade is scheduled against.

What changes in PostgreSQL 18 and what each change asks of you

This table lists the PostgreSQL 18 changes most likely to affect a 17 to 18 upgrade, with the impact of each and the specific check or decision it requires. Read each row as a question to answer in your test environment before scheduling the cutover, starting with the checksum and MD5 rows because they affect cluster setup and login behavior.

ChangeImpact on a 17 to 18 upgradeCheck or decision before cutover
Data checksums on by default in initdbNew clusters created with initdb have checksums enabled unless --no-data-checksums is passed. An existing 17 cluster's checksum setting does not change by itself, so the new cluster's setting must match what pg_upgrade expects.Run SHOW data_checksums on the 17 cluster and compare it with the new 18 cluster. Decide whether to keep checksums on, and record the choice in the runbook.
VACUUM and ANALYZE process inheritance childrenUnqualified VACUUM and ANALYZE on a parent table now also process its child tables. Maintenance jobs that assumed parent-only behavior may run longer and touch more data.Review scheduled maintenance scripts and autovacuum-related jobs for parent tables with children. Decide whether to use the ONLY option to keep the previous behavior for specific jobs.
Virtual generated columns by defaultGenerated columns are computed at read time rather than stored, unless STORED is specified. Queries that filter or index on these columns can behave differently, and schemas that relied on stored values need review.List generated columns in the 17 schema and note which ones need STORED. Test indexes, constraints and query plans that reference them.
MD5 password deprecationCREATE ROLE and ALTER ROLE now emit deprecation warnings when setting MD5 passwords. Roles and clients still using MD5 hashes remain a migration item rather than an automatic break in this release.Query the role catalog for MD5-hashed passwords and list the roles and client applications that depend on them. Plan the move to SCRAM-SHA-256 before the cutover date.
Asynchronous I/OPostgreSQL 18 adds asynchronous I/O, which changes how some read paths perform on your storage. Results depend on workload, operating system and storage type, so behavior is not uniform across environments.Benchmark representative queries and maintenance on the same hardware and storage as production. Decide on settings for the new I/O behavior based on those results, not defaults alone.
pg_upgrade retains planner statisticsPlanner statistics carry over through a major upgrade, so the new cluster may not need a full ANALYZE before serving traffic. This is a time-saving change, but the statistics still reflect the old data distribution.Confirm in a rehearsal that query plans are acceptable immediately after the upgrade. Decide whether to run ANALYZE anyway as a post-cutover check.

How data checksums affect pg_upgrade on your cluster

PostgreSQL 18 enables data checksums by default when initdb creates a new cluster, so a plain initdb call now produces a checksummed cluster unless you pass --no-data-checksums. Before you build the new cluster, find out what the PostgreSQL 17 cluster uses. Run pg_controldata against the old data directory and read the "Data page checksum version" line. A nonzero value means checksums are on, and zero means they are off. Record the result in your change ticket. The checksum setting is fixed when a cluster is initialized, so the new cluster's setting is a decision you make now, not a detail you adjust during cutover.

Once you know the old state, decide what the new cluster should do. If the old cluster has checksums on, keeping them on in PostgreSQL 18 is the straightforward path, and you should confirm in the release notes how pg_upgrade treats any mismatch before you script the build. If the old cluster has checksums off, decide whether turning them on is part of this change or a later project. Using --no-data-checksums keeps the two clusters matched, but make that a documented choice with an owner, not a default carried forward by accident. Also decide who approves the setting, because a later change to it is a separate offline task.

Test the decision on a copy of your data before production. Build a rehearsal cluster with the chosen setting, run the upgrade, and confirm the checksum state of the new cluster with pg_controldata again. Measure the workload impact of the setting during the same rehearsal, using your own queries and volumes. Then write the chosen flags and the verification steps into the cutover runbook so the production build matches what you tested. Read the PostgreSQL 18 release notes for the current pg_upgrade behavior before you finalize the runbook.

What to prepare before the upgrade window opens

Most failed major upgrades trace back to work done, or skipped, weeks before the cutover. The six items below give you a recovery path, a complete picture of what the cluster depends on, and evidence that the new version behaves the same under your workload.

Verified backup and archived WAL

Take a base backup and confirm that archived WAL files cover the whole period up to the upgrade. Point-in-time recovery depends on this chain, so a backup that has never been restored does not count as protection. Restore it to a separate host and check that the cluster starts and the row counts match. Record the exact time the backup finished, because it is the point you would return to if the upgrade is abandoned. Ask your team who owns the restore runbook during the window.

Continuous archiving docs

Extension and custom object inventory

List every extension installed in each database, the shared libraries it loads, and any custom functions, operators, casts, event triggers or foreign data wrappers. Each extension needs a build for PostgreSQL 18 before the cutover, and some extensions need a matching update step after pg_upgrade. Also list objects in the pg_catalog and system-adjacent schemas that your applications call directly. Mark any item that has no maintained PostgreSQL 18 build as a blocker, and decide with the owner whether to replace it or drop it.

Role inventory and MD5 password hashes

Query pg_authid for roles whose stored password begins with the MD5 prefix, and record which applications and users authenticate as each one. PostgreSQL 18 deprecates MD5 password authentication, and CREATE ROLE and ALTER ROLE warn when you set an MD5 password. Check pg_hba.conf for any md5 method entries as well. Plan the password reset and the client driver check together, because a role reset without a driver check can lock out a service at cutover. Confirm with each owner which accounts are human, which are service accounts and which can be retired.

Test environment built from a recent copy

Restore a recent backup into an isolated environment with the same operating system, extensions and configuration as production, then run pg_upgrade --check against it. Treat a clean check as the start of testing, not the end, because the check does not exercise your queries. Keep the test copy old enough to be realistic but fresh enough that the data matches what production will hold on the day. Ask who owns the environment, how long it is reserved, and how the rehearsal results are recorded.

Application and driver compatibility checks

Run the test suites of each application against PostgreSQL 18 and confirm that every client driver, connection pooler and ORM in the path supports the version and the SCRAM authentication your roles will use. Pay attention to features that changed behavior in this release, including VACUUM and ANALYZE processing inheritance children and generated columns that are now virtual by default. Where an application relies on stored generated values or on inheritance scope, write the change down as a required code or schema fix before the window opens.

PostgreSQL 18 release notes

Monitoring baselines for comparison

Capture query latency, connection counts, replication lag, WAL volume, checkpoint frequency and autovacuum activity for a representative period before the upgrade. Without a baseline, you cannot tell whether a slowdown after cutover is caused by the new version, a changed plan or an unrelated load shift. PostgreSQL 18 retains planner statistics across major upgrades, which removes one common cause of post-upgrade slowness, so compare your post-cutover numbers against these baselines rather than assuming a regression. Agree in advance which metrics trigger a rollback decision.

How to sequence the PostgreSQL 17 to 18 cutover

This sequence moves a PostgreSQL 17 cluster to PostgreSQL 18 in an order where every step has a check and a point you can return to the old cluster. Each step finishes with evidence that the next one is safe to start.

  1. Build the PostgreSQL 18 cluster beside the old one

    The platform team installs PostgreSQL 18 binaries on the target hosts or containers and initializes a new cluster with initdb, alongside the existing PostgreSQL 17 cluster. Decide during initdb whether data checksums stay on, since PostgreSQL 18 enables them by default and the --no-data-checksums option turns them off. Confirm that the old cluster's data checksum setting matches your choice, because pg_upgrade needs that to line up. The step is done when the new cluster starts, accepts connections and reports the expected checksum setting. Keep the old cluster untouched so it remains the rollback point.

  2. Run a pg_upgrade check on a copy

    Restore a recent copy of the PostgreSQL 17 data directory to a scratch host, then run pg_upgrade with the --check option against it. The check reads the old catalog, flags incompatible extensions, reserved names, removed features and authentication settings, and reports problems without changing data. Work through every reported item before scheduling the real cutover. The step closes when the check finishes with no blocking errors and you have a list of any warnings to resolve, including the MD5 password deprecation warnings that CREATE ROLE and ALTER ROLE emit in PostgreSQL 18.

  3. Fix extensions and authentication before rehearsal

    Install PostgreSQL 18 builds of every extension the database uses, then check that each one loads in the new cluster. Review pg_hba.conf and role passwords, because PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, and roles with MD5 hashes will generate warnings. Plan the SCRAM password resets with the application owners, since a reset can break clients that do not yet support SCRAM. The step is done when the check from the previous step runs clean for extensions and the authentication inventory is complete, with an owner for each remaining MD5 role. Rollback at this stage costs nothing because no production data has moved.

  4. Rehearse the full cutover and record timings

    Run the complete sequence on a copy of production, from the freeze through pg_upgrade, post-upgrade steps and application tests. Record how long each stage takes, including the pg_upgrade run with the parallel jobs option you intend to use, and the time for the post-upgrade statistics and VACUUM work. Note any step that needs manual intervention. The rehearsal is complete when two consecutive runs succeed and the recorded timings let you set a realistic maintenance window with the business owners. If timings or results differ between runs, fix the cause before moving on.

  5. Freeze writes and take a verified backup

    Stop application writes at the agreed point, either by putting the application into maintenance mode or by blocking the write roles, then confirm that no sessions are still writing. Shut down the PostgreSQL 17 cluster cleanly and take a fresh base backup or verified dump so you hold a restorable copy independent of the upgrade. Check that the backup restores into a test instance before continuing. The step is done when the old cluster is stopped, the backup is confirmed restorable and the write freeze is documented. Until pg_upgrade begins, restarting the old cluster and reopening writes is a clean rollback.

  6. Run pg_upgrade with parallel jobs and the swap option

    Run pg_upgrade from the PostgreSQL 18 binaries against the frozen PostgreSQL 17 data, using the parallel jobs option sized to your hardware and the swap option only if you have chosen it after rehearsal. The swap option is available in PostgreSQL 18 and changes how the old data directory is handled, so confirm its effect on your rollback plan before using it. The tool reports progress and writes a script for updating extensions. The step is done when pg_upgrade reports success, the new cluster starts and the row counts or checksums on sample tables match the pre-cutover values. The old cluster remains your rollback point until the next steps are passed.

  7. Run post-upgrade statistics and extension steps

    Run the extension update script that pg_upgrade generated, then review the planner statistics. PostgreSQL 18 retains planner statistics across major upgrades, so run ANALYZE only where the release notes or your rehearsal show it is needed. Review VACUUM and ANALYZE schedules, since these commands now process inheritance children of partitioned or inherited tables unless the ONLY option is used. Check generated columns, which are virtual by default in PostgreSQL 18, and confirm any code that depends on stored generated columns. The step is done when the extension script completes without errors and your maintenance jobs are reviewed and documented.

  8. Verify application behavior and asynchronous I/O

    Reopen the application to a limited test group, then run your functional tests, performance checks and connection tests against the PostgreSQL 18 cluster. Include an I/O workload test to observe how asynchronous I/O behaves on your storage, because PostgreSQL 18 adds asynchronous I/O and the effect depends on the hardware and kernel. Compare key query timings with your baseline and confirm that authentication works for every client using the new password methods. The step closes when agreed acceptance checks pass and the business owner signs off. Keep the old cluster intact until this sign-off is recorded.

  9. Keep the old cluster for rollback, then retire it

    Leave the PostgreSQL 17 data directory and its binaries in place for a period agreed in advance with the application owners, and keep backups running on the new cluster. Monitor errors, slow queries and authentication failures during this window. Retire the old cluster only after the agreed period closes with no open issues, and record the decision, the final backup location and the rollback procedure used during the window. Logical replication is an alternative to this sequence: the PostgreSQL documentation notes it can perform a major upgrade with only several seconds of downtime, and it leaves a different rollback path, so confirm which method fits your downtime budget before rehearsal starts. The step is done when the old cluster is removed under a documented decision.

Handling MD5 deprecation warnings and authentication changes

PostgreSQL 18 deprecates MD5 password authentication in favor of SCRAM, and CREATE ROLE and ALTER ROLE now emit a warning whenever they set an MD5 password. The warning is the easiest signal to miss during a rehearsal, so start the upgrade by listing which roles still hold MD5 hashes. Query pg_authid on the source cluster and look for password hashes that begin with md5, and record which roles those are, which applications use them, and whether any batch job or monitoring agent depends on them. Confirm the exact behavior for your target build against the PostgreSQL 18 release notes before you rely on it in a runbook.

Finding MD5 roles is only half the work. Each pg_hba.conf line that uses md5 as its method must be reviewed and changed to scram-sha-256 where the client supports it, and password_encryption should be set to scram-sha-256 so new passwords are stored correctly. Client drivers, connection poolers and ETL tools also need to support SCRAM. Check each one in a staging cluster that mirrors production, because a driver that cannot negotiate SCRAM will fail only when a real login is attempted. Plan a password reset for every role that still holds an MD5 hash, scheduled with the application owners so credentials can be rotated in the same window.

OAuth 2.0 is also new in PostgreSQL 18, but it is optional for this upgrade. Do not add it to the cutover scope unless you already have an identity provider and a documented requirement for token-based login. Keeping the authentication change limited to SCRAM makes the rollback path simpler, and the OAuth method can be evaluated separately once the cluster is stable. Confirm your client authentication methods against the PostgreSQL authentication methods documentation and record the decision in the change plan.

Testing asynchronous I/O before production cutover

PostgreSQL 18 adds asynchronous I/O, which lets the server issue more than one read at a time for some operations instead of waiting for each block in turn. Whether that helps depends on the storage, the operating system and the workload, so a test cluster is the place to find out whether your setup gains anything before any production data moves. Build the test cluster from a recent copy of your schema and a representative sample of data, then run the same queries and batch jobs against a PostgreSQL 17 baseline and the PostgreSQL 18 build. Keep the hardware, kernel and configuration as close to each other as possible so the comparison isolates the server version.

  • Fixed baseline: Record PostgreSQL 17 latency and throughput for the same workload before changing anything else.
  • Same configuration: Compare settings such as shared buffers and the I/O-related parameters, and note any that differ between versions.
  • Workload mix: Include scans of large tables, index lookups, vacuum runs and the reporting jobs your application actually executes.
  • Repeated runs: Run each test several times so cache state and background activity do not decide the result.

Before relying on these numbers, confirm the I/O settings and their defaults for your build in the PostgreSQL 18 release notes.

What makes a PostgreSQL 17 to 18 upgrade take longer

This table lists the factors that lengthen a PostgreSQL 17 to 18 upgrade, how each one raises effort, and what keeps it under control. Read each row against your own estate to see which drivers apply and which ones your team can reduce before the cutover window.

DriverWhy it raises effortWhat reduces it
Database size and copy or link modeCopy mode duplicates data on disk and takes longer to run, while link mode is faster but ties the old and new clusters together, so rollback options narrow.Confirm the pg_upgrade mode you need, measure a full rehearsal on a restored copy, and agree the rollback path before the window.
Number of extensions needing matching buildsEach extension needs a build for PostgreSQL 18 installed in the new cluster, and any extension without one blocks the cutover.Inventory every extension and confirm a PostgreSQL 18 build exists from the vendor before scheduling.
Replicas and cluster managerStandbys must be rebuilt or upgraded in step with the primary, and Patroni or Kubernetes operators add their own steps for pausing failover and managing state.Document the replica order, pause automatic failover during the window, and rehearse the cluster manager steps.
Roles still using MD5 passwordsPostgreSQL 18 deprecated MD5 password authentication, and CREATE ROLE and ALTER ROLE emit warnings, so each role needs review and a password reset to move to SCRAM.Query the role catalog for MD5 hashes early, reset passwords, and confirm client drivers support SCRAM.
Inheritance and partitioned table usagePostgreSQL 18 changed VACUUM and ANALYZE to process inheritance children, which can change run time and maintenance schedules for heavily inherited schemas.Identify inheritance trees, test maintenance jobs on a restored copy, and use the ONLY option where the old behavior is required.
Generated columns and stored dataGenerated columns are virtual by default in PostgreSQL 18, so queries, indexes and application assumptions about stored values may need review.List generated columns, check whether any rely on stored values, and test the affected queries.
Application drivers and connection poolingClient libraries and pooler configurations may not yet handle SCRAM or the new behavior, and each application team must test against the new server.Ask each team to confirm driver versions and run integration tests against a PostgreSQL 18 instance before cutover.
Asynchronous I/O and performance baselinesAsynchronous I/O is new in PostgreSQL 18, so I/O behavior on your storage may differ and the team needs baseline measurements to judge it.Capture performance baselines on PostgreSQL 17, repeat them on 18, and tune I/O settings only after measuring.
Number of environments needing rehearsalEach environment, including development, staging, disaster recovery and any air-gapped copy, needs its own upgrade run and verification, which multiplies the work.Use one scripted runbook across environments, rehearse on the most production-like copy first, and record differences between them.

How the upgrade phases and rollback points connect

The upgrade starts with an inventory of extensions, roles, MD5 passwords and checksum settings, then moves to a rehearsal on a copy of the PostgreSQL 17 cluster. Only after a clean pg_upgrade --check run does the cutover begin, with writes frozen while the new cluster takes over. The PostgreSQL 17 cluster stays intact until verification passes, so the rollback branch remains open for the whole verification window. Check each hand-off before moving on.

Phases of a PostgreSQL 17 to 18 upgrade and where rollback stays available.

Questions buyers ask before upgrading PostgreSQL 17 to 18

What drives the cost of a PostgreSQL 17 to 18 upgrade?

The cost depends mostly on how many clusters, replicas and extensions are involved, and on how much testing your environment needs before cutover. Scope sets the effort: a single standalone server with no extensions is a much smaller job than a replicated cluster with PostGIS, pgvector or custom procedures. Ask any partner for a written scope that lists the clusters, the upgrade method, the extensions to verify, the application test cases and the rehearsal count. Separate one-time work (assessment, rehearsal, cutover, documentation) from recurring work (patching, minor releases, monitoring), because the recurring part continues after the move to 18. No price is given here; a quote follows from the written scope.

How long does a PostgreSQL 17 to 18 upgrade take?

The window is set by your data size, your downtime budget, the upgrade method and how many rehearsals your change process requires. PostgreSQL 17 is supported until November 8, 2029, so there is no fixed deadline driven by support end dates for this move, which gives you room to plan the window rather than rush it. A pg_upgrade run in link mode is usually the quickest path to a cutover, while a logical replication cutover is measured in several seconds of downtime, though it takes longer to set up and verify. Ask for a schedule that shows the rehearsal runs, the application regression tests and the rollback checkpoint as separate milestones.

What does our team need to provide for the upgrade?

The upgrade needs access and knowledge that only your organization holds. Provide access to the production and staging clusters, backup and restore access, the list of installed extensions and their versions, the connection strings and pooler settings, the authentication configuration in pg_hba.conf, and the application owners who can sign off on test results. You also need a named change approver and a maintenance window that your operations team accepts. Confirm with your infrastructure team which hosts, storage and network paths the upgrade touches, since those details decide the rehearsal plan.

Can our own database team upgrade PostgreSQL 17 to 18 without a partner?

Yes, an experienced in-house team can perform the upgrade if it has time to rehearse and the skills to read the release notes and run pg_upgrade. The questions that decide this are whether the team has done a major upgrade before, whether it can test the applications that depend on the database, and whether it can keep normal operations running during the change. The PostgreSQL 18 release notes list changes that deserve a checklist, including data checksums enabled by default in initdb, VACUUM and ANALYZE processing inheritance children, virtual generated columns and the MD5 deprecation warnings. A partner is most useful when the team lacks rehearsal capacity or needs an independent review of the plan before the window.

How does rollback work after a PostgreSQL 18 cutover?

Rollback depends on the method you choose and on whether you keep the PostgreSQL 17 cluster intact until the new version is accepted. With pg_upgrade in link mode, the old data files are changed in place, so the old cluster cannot be started again after the new one runs; copy mode keeps the original files available. With logical replication, the PostgreSQL 17 source can stay in place as a fallback, but writes made after cutover must be replayed back if you need to reverse direction. Ask for a written rollback procedure with a decision deadline, a tested restore from backup, and the exact point after which rollback is no longer possible.

Does the upgrade to PostgreSQL 18 require downtime?

Some downtime is unavoidable with pg_upgrade, because the server must stop for the cutover, and the length depends on the mode and the size of the data. Logical replication reduces the outage: the PostgreSQL upgrading documentation describes a major upgrade with only several seconds of downtime using this method, though the setup and verification work is larger. Plan for the application pause, connection draining through your pooler and the validation step before you reopen traffic. Confirm the actual window with a rehearsal on a copy of production, because the result depends on your data volume, extensions and replica topology.

How DeployOpen scopes and delivers your PostgreSQL 18 upgrade

DeployOpen plans and delivers PostgreSQL 17 to 18 upgrades inside infrastructure you control, starting from a written scope that names the clusters, extensions, applications and cutover window involved. Each stage produces documented evidence so your own database, security and compliance teams can review the upgrade before and after it runs.

How we scope

  • Inventory every PostgreSQL 17 cluster, its extensions, client drivers and authentication methods before any work starts.
  • Record which MD5 password roles and pg_hba.conf entries need SCRAM changes, with owners named for each one.
  • Agree in writing whether the upgrade uses pg_upgrade or logical replication, and the rollback path for each choice.
  • Engagements are fixed-scope, so deliverables, environments and timelines are agreed in writing before work begins.

How we build

  • Rehearse the upgrade on a copy of production, running pg_upgrade --check and recording every reported incompatibility.
  • Review checksum settings for the new cluster, since PostgreSQL 18 enables data checksums by default in initdb.
  • Test VACUUM and ANALYZE behavior on partitioned and inheritance-based tables, and confirm the ONLY option where needed.
  • Measure query plans and asynchronous I/O settings under representative load before the cutover window is fixed.

How we hand over

  • Deliver a runbook covering pre-checks, cutover steps, post-upgrade statistics and rollback commands, tested during rehearsal.
  • Document each MD5 deprecation warning found, its fix, and the evidence that no role still authenticates with MD5.
  • Provide configuration records, extension versions and test results that your compliance team can review directly.
  • Walk your operators through the cutover so they can run the next upgrade on their own team.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the PostgreSQL 18 cutover.
  • Cover follow-up minor releases, which only swap binaries and restart, under the same written scope if agreed.
  • Confirm with your team the support window you need, since PostgreSQL 18 support runs to November 14, 2030.
  • Re-run upgrade checks and retest authentication settings when extensions or client drivers change.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.