semver
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_semver | 0.42.0 | TYPE | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3510 | semver | No | Yes | No | Yes | No | Yes | - |
| Related | pg_text_semver debversion |
|---|
0.42.0 changes hashing; REINDEX all semver hash indexes.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 0.42.0 | 1817161514 | pg_semver | - |
| RPM | PGDG | 0.42.0 | 1817161514 | semver_$v | - |
| DEB | PGDG | 0.42.0 | 1817161514 | postgresql-$v-semver | - |
Build
You can build the RPM / DEB packages for pg_semver using pig build:
Install
You can install pg_semver directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
semver provides a Semantic Versioning 2.0.0 data type, comparison operators and the semverrange range type. Version 0.42.0 changes hashing: after upgrading, rebuild every hash index on semver values.
Core Workflow
Operational Boundaries
semver(text) and casts from text require valid semantic versions; to_semver(text) performs more permissive conversion, and is_semver(text) checks validity. get_semver_major, get_semver_minor and get_semver_patch return integer components; get_semver_prerelease returns the prerelease text. Casts also accept numeric, real, double precision, integer, bigint and smallint. Version 0.42.0 rejects Infinity and NaN instead of producing malformed versions.
The comparison operators =, <>, <, <=, > and >=, plus MIN(semver) and MAX(semver), use semantic ordering. A prerelease sorts before its final release; build metadata does not affect precedence. Btree and hash indexes are available. semverrange supports standard range operations.
Install this native, untrusted extension with administrator privileges. After installing 0.42.0, run ALTER EXTENSION semver UPDATE and use REINDEX on every existing hash index containing semver keys. The hash change is not repaired by updating the extension’s SQL definitions alone. The release also fixes ordering of alphanumeric prerelease identifiers beginning with a digit and validation of strings with multiple plus signs. When upgrading from old releases, inspect the upstream compatibility notes for previously accepted invalid values.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)