pg_text_semver

Semantic version domain and comparison operators for PostgreSQL

Overview

PackageVersionCategoryLicenseLanguage
pg_text_semver1.2.1TYPEPostgreSQLSQL
IDExtensionBinLibLoadCreateTrustRelocSchema
3520pg_text_semverNoNoNoYesNoYes-

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.2.11817161514pg_text_semver-
RPMPIGSTY1.2.11817161514pg_text_semver_$v-
DEBPIGSTY1.2.11817161514postgresql-$v-pg-text-semver-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
d12.x86_64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
d12.aarch64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
d13.x86_64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
d13.aarch64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
u22.x86_64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
u22.aarch64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
u24.x86_64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
u24.aarch64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1

Build

You can build the RPM / DEB packages for pg_text_semver using pig build:

pig build pkg pg_text_semver         # build RPM / DEB packages

Install

You can install pg_text_semver directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install pg_text_semver;          # Install for current active PG version
pig ext install -y pg_text_semver -v 18  # PG 18
pig ext install -y pg_text_semver -v 17  # PG 17
pig ext install -y pg_text_semver -v 16  # PG 16
pig ext install -y pg_text_semver -v 15  # PG 15
pig ext install -y pg_text_semver -v 14  # PG 14
dnf install -y pg_text_semver_18       # PG 18
dnf install -y pg_text_semver_17       # PG 17
dnf install -y pg_text_semver_16       # PG 16
dnf install -y pg_text_semver_15       # PG 15
dnf install -y pg_text_semver_14       # PG 14
apt install -y postgresql-18-pg-text-semver   # PG 18
apt install -y postgresql-17-pg-text-semver   # PG 17
apt install -y postgresql-16-pg-text-semver   # PG 16
apt install -y postgresql-15-pg-text-semver   # PG 15
apt install -y postgresql-14-pg-text-semver   # PG 14

Create Extension:

CREATE EXTENSION pg_text_semver;

Usage

  • Source: GitHub repo, README
  • pg_text_semver implements Semantic Versioning 2.0.0 on top of PostgreSQL text, using a semver domain and related helper types/functions.
CREATE EXTENSION pg_text_semver;

Core Workflow

The README highlights these capabilities:

  • compare semver values with the usual comparison operators
  • call semver_cmp(semver, semver) directly
  • validate and inspect version strings with semver_regexp()
  • cast parsed values to semver_parsed for sorting and indexing
  • use semver_prerelease for prerelease validation and comparison

Examples

The upstream README points users to the test__pg_text_semver() procedure for concrete examples of the types, operators, and functions. It also notes that the extension ships a separate semver_parsed type that can be serialized back to semver or text.

Notes

The README contrasts this project with C-based semver extensions: pg_text_semver stays on text-backed domains and focuses on a simple, spec-oriented implementation.


Last Modified 2026-04-14: update extension catalog (29617e5)