Skip to content

Instantly share code, notes, and snippets.

View truemogician's full-sized avatar

0x269 truemogician

  • Tongji University
  • China
  • 06:42 (UTC +08:00)
View GitHub Profile
@truemogician
truemogician / upgrading_postgresql_in_windows.md
Last active November 3, 2024 16:33
Upgrading PostgreSQL in Windows

Upgrading PostgreSQL in Windows

The official documentation for PostgreSQL provides a guide to upgrading using pg_upgrade. However, it can be a bit like a treasure hunt with hidden traps. This gist will walk you through a clear and robust method for upgrading PostgreSQL on Windows, using the upgrade from version 14 to 16 as an example.

1. Install the New Version of PostgreSQL

Before you embark on the upgrade journey, make sure you have the new version installed. This is because the pg_upgrade utility used during the upgrade process belongs to the newer version.

To get started, visit the official download page, download the installer, and run it. A word of caution: do not overwrite the old installation, as you'll need its binaries and data for the upgrade.