A newer Postgres version
Peat runs Postgres 18 and 19. A new database takes the Platform’s default (computes.defaultPgVersion) unless you name one:
peat make orders --pg 19Moving a database to a newer version
Section titled “Moving a database to a newer version”peat move orders --pg 19or raise spec.pgVersion on the Database. The database keeps its name, address and login.
A move is a copy, not an in-place upgrade. While it runs:
- A new copy on the newer version is started beside the old one.
- The door is shut for the length of the copy: new connections are refused and open sessions are ended. Plan for that.
- Everything is copied, then the two sides are compared: the databases, roles, settings, every kind of object, and every table’s row count.
- If they are equal, the name is pointed at the new copy and the door opens. If anything differs, nothing is switched, the door opens on the old version, and the status says what failed.
The old copy is kept, stopped, as orders-pg18 for keepOldFor (30 days by default).
Rehearse first
Section titled “Rehearse first”peat move orders --pg 19 --rehearseA rehearsal copies and compares every row with the door open, and switches nothing. It tells you whether the move would pass and
how long the door would be shut (status.move.seconds on the Database). Run one before a real move of anything that matters.
peat move orders --pg 19 --verify full makes the real move compare every row as well, at the cost of a longer shut door.
If it fails, or you change your mind
Section titled “If it fails, or you change your mind”peat move orders --retry # try a failed move againpeat move orders --back # return to the old version, while its copy is keptGoing back is refused when the database was written since the move, since those writes would be lost.
Limits
Section titled “Limits”- A version is never lowered except by
--back. - A database with read replicas is not moved: delete them, move, make them again.
- Replication slots are not carried over, and a subscription arrives disabled.
- The full account, with what the comparison does and does not catch, is in the reference.