Skip to content
pg_text_semver

pg_text_semver

pg_text_semver : Semantic version domain and comparison operators for PostgreSQL

Overview

ID Extension Package Version Category License Language
3520
pg_text_semver
pg_text_semver
1.2.1
TYPE
PostgreSQL
SQL
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
----d-r
No
No
No
Yes
yes
no

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
1.2.1
18
17
16
15
14
pg_text_semver -
RPM
PIGSTY
1.2.1
18
17
16
15
14
pg_text_semver_$v -
DEB
PIGSTY
1.2.1
18
17
16
15
14
postgresql-$v-pg-text-semver -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
el8.aarch64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
el9.x86_64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
el9.aarch64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
el10.x86_64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
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
u26.x86_64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
u26.aarch64
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
PIGSTY 1.2.1
Package Version OS ORG SIZE File URL
pg_text_semver_18 1.2.1 el8.x86_64 pigsty 22.0 KiB pg_text_semver_18-1.2.1-1PIGSTY.el8.x86_64.rpm
pg_text_semver_18 1.2.1 el8.aarch64 pigsty 21.9 KiB pg_text_semver_18-1.2.1-1PIGSTY.el8.aarch64.rpm
pg_text_semver_18 1.2.1 el9.x86_64 pigsty 21.6 KiB pg_text_semver_18-1.2.1-1PIGSTY.el9.x86_64.rpm
pg_text_semver_18 1.2.1 el9.aarch64 pigsty 21.6 KiB pg_text_semver_18-1.2.1-1PIGSTY.el9.aarch64.rpm
pg_text_semver_18 1.2.1 el10.x86_64 pigsty 21.8 KiB pg_text_semver_18-1.2.1-1PIGSTY.el10.x86_64.rpm
pg_text_semver_18 1.2.1 el10.aarch64 pigsty 21.7 KiB pg_text_semver_18-1.2.1-1PIGSTY.el10.aarch64.rpm
postgresql-18-pg-text-semver 1.2.1 d12.x86_64 pigsty 19.3 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~bookworm_amd64.deb
postgresql-18-pg-text-semver 1.2.1 d12.aarch64 pigsty 19.3 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~bookworm_arm64.deb
postgresql-18-pg-text-semver 1.2.1 d13.x86_64 pigsty 19.3 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~trixie_amd64.deb
postgresql-18-pg-text-semver 1.2.1 d13.aarch64 pigsty 19.3 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~trixie_arm64.deb
postgresql-18-pg-text-semver 1.2.1 u22.x86_64 pigsty 19.8 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~jammy_amd64.deb
postgresql-18-pg-text-semver 1.2.1 u22.aarch64 pigsty 19.8 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~jammy_arm64.deb
postgresql-18-pg-text-semver 1.2.1 u24.x86_64 pigsty 19.7 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~noble_amd64.deb
postgresql-18-pg-text-semver 1.2.1 u24.aarch64 pigsty 19.7 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~noble_arm64.deb
postgresql-18-pg-text-semver 1.2.1 u26.x86_64 pigsty 19.7 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~resolute_amd64.deb
postgresql-18-pg-text-semver 1.2.1 u26.aarch64 pigsty 19.7 KiB postgresql-18-pg-text-semver_1.2.1-1PIGSTY~resolute_arm64.deb

Source

pig build pkg pg_text_semver;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install pg_text_semver;		# install via package name, for the active PG version

pig install pg_text_semver -v 18;   # install for PG 18
pig install pg_text_semver -v 17;   # install for PG 17
pig install pg_text_semver -v 16;   # install for PG 16
pig install pg_text_semver -v 15;   # install for PG 15
pig install pg_text_semver -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION pg_text_semver;

Usage

Source: README, META.json, Tag v1.2.1

pg_text_semver implements Semantic Versioning 2.0.0 on top of PostgreSQL text using a semver domain rather than a custom C type.

Core types and functions

CREATE EXTENSION pg_text_semver;

SELECT '1.2.3'::semver < '2.0.0'::semver;
SELECT semver_cmp('1.2.3'::semver, '1.2.4'::semver);
SELECT semver_regexp(true);
SELECT '1.2.3-alpha.1+build5'::semver::semver_parsed;
  • semver: domain over text with SemVer validation.
  • semver_parsed: parsed composite type that supports sorting and indexing.
  • semver_prerelease: domain for prerelease identifiers.
  • semver_cmp(...): comparison function for semver and semver_parsed.
  • semver_regexp(include_captures boolean): exposes the validation regex.

Extra helpers

The current README also documents PGXN-version-range helpers:

  • meta_pgxn_version_range(text)
  • meta_pgxn_version_range_cmp(text, text)
  • nonsemver_cmp(text, text, text)

Caveats

  • This extension favors a spec-oriented, text-backed implementation over the lower-level C-based alternatives.
  • The upstream README remains the authoritative user-facing reference; the current stub already matched that surface closely, so this refresh mainly aligns it with the documented 1.2.1 helper set.
Last updated on