Skip to content

conda_pgsql_rust_ext

Conda version data type and helpers for PostgreSQL, implemented with pgrx and rattler_conda_types.

data_experiments · Conda version data type and helpers for PostgreSQL, implemented with pgrx and rattler_conda_types.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100890conda_pgsql_rust_extdata_experiments0.0.0TYPEMITRust

PostgreSQL · 13, 14, 15, 16, 17

Usage

Sources:

conda_pgsql_rust_ext provides a condaversion type backed by rattler_conda_types. Use it when Conda package versions must be parsed, compared, indexed, or aggregated according to Conda version ordering instead of ordinary text ordering.

Core Workflow

Create the extension, store versions in a typed column, and use the normal comparison and aggregate syntax:

CREATE EXTENSION conda_pgsql_rust_ext;

CREATE TABLE package_release (
    package text NOT NULL,
    version condaversion NOT NULL
);

INSERT INTO package_release VALUES
    ('demo', '1.1dev1'),
    ('demo', '1.1.0'),
    ('demo', '1!0.4.1');

SELECT version::text
FROM package_release
WHERE package = 'demo'
ORDER BY version;

SELECT min(version), max(version)
FROM package_release;

The type accepts Conda version strings, retains the original spelling for text output, and supplies equality, ordering, hashing, plus min(condaversion) and max(condaversion) aggregates. Invalid Conda syntax raises an input error.

Operational Notes

The reviewed upstream revision reports crate version 0.0.0. The control file marks the extension non-relocatable, untrusted, and superuser-only; it does not declare a preload requirement. Treat the early version number as an API-stability warning, and test comparison behavior with the exact version forms used by your package metadata before adopting it for constraints or unique indexes.

Table reader