<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/upgrading-postgresql-9-6-to-17-with-pg-sbhxuocvy" -->

---
title: Upgrading PostgreSQL 9.6 to 17 with pg | daily.dev
description: A step-by-step guide for upgrading PostgreSQL 9.6 to 17 on Ubuntu using pg_upgrade. Covers all phases: installing PG17 binaries, initializing the new cluster,...
canonical: https://daily.dev/posts/upgrading-postgresql-9-6-to-17-with-pg-sbhxuocvy
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Upgrading PostgreSQL 9.6 to 17 with pg | daily.dev
og:description: A step-by-step guide for upgrading PostgreSQL 9.6 to 17 on Ubuntu using pg_upgrade. Covers all phases: installing PG17 binaries, initializing the new cluster,...
og:url: https://daily.dev/posts/upgrading-postgresql-9-6-to-17-with-pg-sbhxuocvy
og:image: https://api.daily.dev/og/posts/SBHxUOCvY.png
og:image:alt: Upgrading PostgreSQL 9.6 to 17 with pg
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrading PostgreSQL 9.6 to 17 with pg

**[Planet PostgreSQL](https://daily.dev/sources/planet-postgresql)** · 8 min read · 0 upvotes · 0 comments

## Summary

A step-by-step guide for upgrading PostgreSQL 9.6 to 17 on Ubuntu using pg_upgrade. Covers all phases: installing PG17 binaries, initializing the new cluster, migrating configuration (including a table of removed/renamed parameters across versions 10–17), handling incompatible extensions like repmgr, running pg_upgrade with the --link flag for fast in-place upgrades, post-upgrade tasks (running analyze_new_cluster.sh, rebuilding hash indexes), and validation queries for checking invalid indexes and extension version mismatches. Key gotchas include the removal of recovery.conf in PG12, password_encryption default change to scram-sha-256 in PG14, and the fact that the old cluster's data directory is tainted after using --link.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://postgr.es/p/9pT>

## Similar posts on daily.dev

- [PostgreSQL 18.1, 17.7, 16.11, 15.15, 14.20, and 13.23 Released\!](https://daily.dev/posts/postgresql-18-1-17-7-16-11-15-15-14-20-and-13-23-released--wwybaugkn) · PostgreSQL · 22 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#postgresql](https://daily.dev/tags/postgresql), [#ubuntu](https://daily.dev/tags/ubuntu)

[View this post on daily.dev](https://daily.dev/posts/upgrading-postgresql-9-6-to-17-with-pg-sbhxuocvy)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Upgrading PostgreSQL 9.6 to 17 with pg","url":"https://daily.dev/posts/upgrading-postgresql-9-6-to-17-with-pg-sbhxuocvy","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/upgrading-postgresql-9-6-to-17-with-pg-sbhxuocvy"},"datePublished":"2026-07-16T09:48:34.911Z","dateModified":"2026-07-16T09:48:59.364Z","description":"A step-by-step guide for upgrading PostgreSQL 9.6 to 17 on Ubuntu using pg_upgrade. Covers all phases: installing PG17 binaries, initializing the new cluster,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f89720ad39731129ae0f94b44fd12f52?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f89720ad39731129ae0f94b44fd12f52?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Planet PostgreSQL","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet PostgreSQL","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/planet-postgresql"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/upgrading-postgresql-9-6-to-17-with-pg-sbhxuocvy","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,postgresql,ubuntu","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet PostgreSQL","item":"https://daily.dev/sources/planet-postgresql"},{"@type":"ListItem","position":3,"name":"Upgrading PostgreSQL 9.6 to 17 with pg"}]}
```

