The one thing to understand first
PostgreSQL’s on-disk format can change between major versions, so you cannot simply start a new binary on the old data directory. The traditional options each have downsides: pg_dump/restore is simple but slow and needs a long outage; pg_upgrade with hard links is fast but still requires stopping the database and is hard to roll back. Logical replication enables a blue/green upgrade with downtime measured in seconds.
Logical replication is version-agnostic — it ships row changes, not WAL bytes — so it lets a new-version “green” instance track an old-version “blue” until you flip traffic in seconds, with blue still intact as a fallback. That cross-version property is the entire reason near-zero-downtime major upgrades are possible.
The blue/green idea
Blue is your current production database. Green is a freshly built instance on the new major version. You replicate all changes from blue to green logically, let green catch up, validate it, then flip application traffic to green in one quick cutover. If anything is wrong, you flip back — blue was never touched destructively.