From 8debece66cdcf65b527fdc6e9dd0ca47b679dbdf Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Mon, 22 Jul 2024 13:50:17 -0400 Subject: [PATCH] Add missing upgrade script And tweak the upgrade incompatibility docs and query. --- Changes | 7 ++++--- doc/semver.mmd | 14 ++++++++++++++ ...32.0--0.40.0.sql => semver--0.32.0--0.32.1.sql} | 0 sql/semver--0.32.1--0.40.0.sql | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) rename sql/{semver--0.32.0--0.40.0.sql => semver--0.32.0--0.32.1.sql} (100%) create mode 100644 sql/semver--0.32.1--0.40.0.sql diff --git a/Changes b/Changes index b3d224d..332def9 100644 --- a/Changes +++ b/Changes @@ -13,9 +13,10 @@ Revision history for PostgreSQL extension semver. Fixed a bug in the scanning of pre-releases that start with a zero. It now properly scans the rest of the pre-release string. As a result, existing semvers with pre-releases the start with a zero may have been - incorrectly interpreted as valid. See the v0.30.0 changes below for - instructions for finding such invalid semvers. Discovered while - debugging unexpected test failures in #70. + incorrectly interpreted as valid. Any versions returned by this query + will need the leading 0 removed from the pre-release before upgrading: + `SELECT version FROM pkg WHERE get_semver_prerelease(version) ~ '^0\[0-9]+($|\+)'` + Discovered while debugging unexpected test failures in #70. 0.32.1 2023-08-01T23:20:31Z - Fixed compilation issue on Postgres 16. diff --git a/doc/semver.mmd b/doc/semver.mmd index 2d84830..36f1148 100644 --- a/doc/semver.mmd +++ b/doc/semver.mmd @@ -73,6 +73,20 @@ comparison operators, are: ------------------------------------------- Prior to v0.40.0, the semver extension incorrectly allowed some invalid +prerelease values. *BEFORE YOU UPGRADE*, we strongly recommend that you check +for and repair semvers. Use this query to find semvers with invalid +pre-release values: + + SELECT name, version FROM packages + WHERE get_semver_prerelease(version) ~ '^0\[0-9]+($|\+)'; + +For any results returned, update them by removing the leading `0` from the +pre-release, or appending an alphbetic value. + +🚨 v0.30.0 Upgrade Compatibility Warning 🚨 +------------------------------------------- + +Prior to v0.30.0, the semver extension incorrectly allowed some invalid prerelease and build metadata values. Details below, but *BEFORE YOU UPGRADE* from an earlier version, we strongly recommend that you check for and repair any invalid semvers. You can find them using the official [SemVer regular diff --git a/sql/semver--0.32.0--0.40.0.sql b/sql/semver--0.32.0--0.32.1.sql similarity index 100% rename from sql/semver--0.32.0--0.40.0.sql rename to sql/semver--0.32.0--0.32.1.sql diff --git a/sql/semver--0.32.1--0.40.0.sql b/sql/semver--0.32.1--0.40.0.sql new file mode 100644 index 0000000..db31038 --- /dev/null +++ b/sql/semver--0.32.1--0.40.0.sql @@ -0,0 +1 @@ +-- C source code changes only; No SQL changes.