Bug 237910 - databases/postgresql11-server: incorrect warning about dump/restore
Summary: databases/postgresql11-server: incorrect warning about dump/restore
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Palle Girgensohn
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2019-05-15 12:14 UTC by Francesco
Modified: 2019-05-15 13:12 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (pgsql)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco 2019-05-15 12:14:21 UTC
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."
(cfr. https://www.postgresql.org/docs/11/upgrading.html)

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.
Comment 1 Palle Girgensohn freebsd_committer 2019-05-15 12:16:43 UTC
Thanks. I'll fix the text to be more correct!

Palle
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2019-05-15 13:02:53 UTC
Is it confirmed the same advice (dump/restore only required across major versions) applies to all currently supported postgresql port versions?
Comment 3 Palle Girgensohn freebsd_committer 2019-05-15 13:10:07 UTC
(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.
Comment 4 Palle Girgensohn freebsd_committer 2019-05-15 13:12:33 UTC
(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

9.4
9.5
9.6
10
11

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.