While updating PostgreSQL server, pkg gives this warning:
=========== BACKUP YOUR DATA! =============
As always, backup your data before
upgrading. If the upgrade leads to a higher
minor revision (e.g. 8.3.x -> 8.4), a dump
and restore of all databases is
required. This is *NOT* done by the port!
The official PostgreSQL documentation says the opposite, actually.
"Minor releases never change the internal storage format and are always compatible with earlier and later minor releases of the same major version number. For example, version 10.1 is compatible with version 10.0 and version 10.6. [...] To update between compatible versions, you simply replace the executables while the server is down and restart the server. The data directory remains unchanged — minor upgrades are that simple."
From the same page:
"Current PostgreSQL version numbers consist of a major and a minor version number. For example, in the version number 10.1, the 10 is the major version number and the 1 is the minor version number, meaning this would be the first minor release of the major release 10. For releases before PostgreSQL version 10.0, version numbers consist of three numbers, for example, 9.5.3. In those cases, the major version consists of the first two digit groups of the version number, e.g., 9.5, and the minor version is the third number, e.g., 3, meaning this would be the third minor release of the major release 9.5."
A backup advice is always a good idea, but the provided information may not be completely correct anymore, since version 10.0.
Thanks. I'll fix the text to be more correct!
Is it confirmed the same advice (dump/restore only required across major versions) applies to all currently supported postgresql port versions?
(In reply to Kubilay Kocak from comment #2)
Moving between two major versions is the same as to moving between two different ports. For example, moving from 9.6 -> 10 or from 10 -> 11 are considered moving between two different major versions.
When moving between two major versions, a dump+restore or pg_upgrade is required.
pg_upgrade is not easily done using the current FreeBSD port framework for postgresql, since it needs both versions installed during the migration. It is on the TODO list to refactor this.
(In reply to Palle Girgensohn from comment #3)
To make it completely clear, postgresql changed their versioning scheme when version 10 was released. The current supported MAJOR versions are
Before version 10, X.Y was considered a major version. With the introduction of version 10, X is considered the major version. This aligns better with popular expectations.