Skip to content

Commit 8debece

Browse files
committed
Add missing upgrade script
And tweak the upgrade incompatibility docs and query.
1 parent 5d00b8d commit 8debece

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

Changes

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ Revision history for PostgreSQL extension semver.
1313
Fixed a bug in the scanning of pre-releases that start with a zero.
1414
It now properly scans the rest of the pre-release string. As a result,
1515
existing semvers with pre-releases the start with a zero may have been
16-
incorrectly interpreted as valid. See the v0.30.0 changes below for
17-
instructions for finding such invalid semvers. Discovered while
18-
debugging unexpected test failures in #70.
16+
incorrectly interpreted as valid. Any versions returned by this query
17+
will need the leading 0 removed from the pre-release before upgrading:
18+
`SELECT version FROM pkg WHERE get_semver_prerelease(version) ~ '^0\[0-9]+($|\+)'`
19+
Discovered while debugging unexpected test failures in #70.
1920

2021
0.32.1 2023-08-01T23:20:31Z
2122
- Fixed compilation issue on Postgres 16.

doc/semver.mmd

+14
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@ comparison operators, are:
7373
-------------------------------------------
7474

7575
Prior to v0.40.0, the semver extension incorrectly allowed some invalid
76+
prerelease values. *BEFORE YOU UPGRADE*, we strongly recommend that you check
77+
for and repair semvers. Use this query to find semvers with invalid
78+
pre-release values:
79+
80+
SELECT name, version FROM packages
81+
WHERE get_semver_prerelease(version) ~ '^0\[0-9]+($|\+)';
82+
83+
For any results returned, update them by removing the leading `0` from the
84+
pre-release, or appending an alphbetic value.
85+
86+
🚨 v0.30.0 Upgrade Compatibility Warning 🚨
87+
-------------------------------------------
88+
89+
Prior to v0.30.0, the semver extension incorrectly allowed some invalid
7690
prerelease and build metadata values. Details below, but *BEFORE YOU UPGRADE*
7791
from an earlier version, we strongly recommend that you check for and repair
7892
any invalid semvers. You can find them using the official [SemVer regular
File renamed without changes.

sql/semver--0.32.1--0.40.0.sql

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-- C source code changes only; No SQL changes.

0 commit comments

Comments
 (0)