Skip to content

pg_cardano

A suite of Cardano-related tools

pg_cardano · A suite of Cardano-related tools

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2920pg_cardanopg_cardano1.2.1FEATMITRust
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d--NoYesNoYesnono

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.2.119 18 17 16 15pg_cardano-
RPMPIGSTY1.2.119 18 17 16 15pg_cardano_$v-
DEBPIGSTY1.2.119 18 17 16 15postgresql-$v-pg-cardano-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
el8.aarch64N/APIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
el9.x86_64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
el9.aarch64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
el10.x86_64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
el10.aarch64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
d12.x86_64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
d12.aarch64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
d13.x86_64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
d13.aarch64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
u22.x86_64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
u22.aarch64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
u24.x86_64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
u24.aarch64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
u26.x86_64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
u26.aarch64PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1PIGSTY 1.2.1
PackageVersionOSORGSIZEFile URL
pg_cardano_191.2.1el9.x86_64pigsty1.0 MiBpg_cardano_19-1.2.1-1PGSTY.el9.x86_64.rpm
pg_cardano_191.2.1el9.aarch64pigsty990.1 KiBpg_cardano_19-1.2.1-1PGSTY.el9.aarch64.rpm
pg_cardano_191.2.1el10.x86_64pigsty1.0 MiBpg_cardano_19-1.2.1-1PGSTY.el10.x86_64.rpm
pg_cardano_191.2.1el10.aarch64pigsty992.3 KiBpg_cardano_19-1.2.1-1PGSTY.el10.aarch64.rpm
postgresql-19-pg-cardano1.2.1d12.x86_64pigsty864.4 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~bookworm_amd64.deb
postgresql-19-pg-cardano1.2.1d12.aarch64pigsty738.1 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~bookworm_arm64.deb
postgresql-19-pg-cardano1.2.1d13.x86_64pigsty863.5 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~trixie_amd64.deb
postgresql-19-pg-cardano1.2.1d13.aarch64pigsty739.1 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~trixie_arm64.deb
postgresql-19-pg-cardano1.2.1u22.x86_64pigsty958.1 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~jammy_amd64.deb
postgresql-19-pg-cardano1.2.1u22.aarch64pigsty869.9 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~jammy_arm64.deb
postgresql-19-pg-cardano1.2.1u24.x86_64pigsty948.1 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~noble_amd64.deb
postgresql-19-pg-cardano1.2.1u24.aarch64pigsty860.6 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~noble_arm64.deb
postgresql-19-pg-cardano1.2.1u26.x86_64pigsty942.3 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~resolute_amd64.deb
postgresql-19-pg-cardano1.2.1u26.aarch64pigsty858.2 KiBpostgresql-19-pg-cardano_1.2.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_cardano_181.2.1el8.x86_64pigsty1.0 MiBpg_cardano_18-1.2.1-1PGSTY.el8.x86_64.rpm
pg_cardano_181.2.1el8.aarch64pigsty923.4 KiBpg_cardano_18-1.2.1-1PGSTY.el8.aarch64.rpm
pg_cardano_181.2.1el9.x86_64pigsty1.0 MiBpg_cardano_18-1.2.1-1PGSTY.el9.x86_64.rpm
pg_cardano_181.2.1el9.aarch64pigsty985.8 KiBpg_cardano_18-1.2.1-1PGSTY.el9.aarch64.rpm
pg_cardano_181.2.1el10.x86_64pigsty1.0 MiBpg_cardano_18-1.2.1-1PGSTY.el10.x86_64.rpm
pg_cardano_181.2.1el10.aarch64pigsty986.3 KiBpg_cardano_18-1.2.1-1PGSTY.el10.aarch64.rpm
postgresql-18-pg-cardano1.2.1d12.x86_64pigsty861.7 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~bookworm_amd64.deb
postgresql-18-pg-cardano1.2.1d12.aarch64pigsty735.6 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~bookworm_arm64.deb
postgresql-18-pg-cardano1.2.1d13.x86_64pigsty862.0 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~trixie_amd64.deb
postgresql-18-pg-cardano1.2.1d13.aarch64pigsty737.2 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~trixie_arm64.deb
postgresql-18-pg-cardano1.2.1u22.x86_64pigsty956.5 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~jammy_amd64.deb
postgresql-18-pg-cardano1.2.1u22.aarch64pigsty868.2 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~jammy_arm64.deb
postgresql-18-pg-cardano1.2.1u24.x86_64pigsty944.9 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~noble_amd64.deb
postgresql-18-pg-cardano1.2.1u24.aarch64pigsty857.1 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~noble_arm64.deb
postgresql-18-pg-cardano1.2.1u26.x86_64pigsty940.0 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~resolute_amd64.deb
postgresql-18-pg-cardano1.2.1u26.aarch64pigsty855.1 KiBpostgresql-18-pg-cardano_1.2.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_cardano_171.2.1el8.x86_64pigsty1.0 MiBpg_cardano_17-1.2.1-1PGSTY.el8.x86_64.rpm
pg_cardano_171.2.1el8.aarch64pigsty919.7 KiBpg_cardano_17-1.2.1-1PGSTY.el8.aarch64.rpm
pg_cardano_171.2.1el9.x86_64pigsty1.0 MiBpg_cardano_17-1.2.1-1PGSTY.el9.x86_64.rpm
pg_cardano_171.2.1el9.aarch64pigsty981.7 KiBpg_cardano_17-1.2.1-1PGSTY.el9.aarch64.rpm
pg_cardano_171.2.1el10.x86_64pigsty1.0 MiBpg_cardano_17-1.2.1-1PGSTY.el10.x86_64.rpm
pg_cardano_171.2.1el10.aarch64pigsty982.7 KiBpg_cardano_17-1.2.1-1PGSTY.el10.aarch64.rpm
postgresql-17-pg-cardano1.2.1d12.x86_64pigsty858.9 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~bookworm_amd64.deb
postgresql-17-pg-cardano1.2.1d12.aarch64pigsty734.4 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~bookworm_arm64.deb
postgresql-17-pg-cardano1.2.1d13.x86_64pigsty859.1 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~trixie_amd64.deb
postgresql-17-pg-cardano1.2.1d13.aarch64pigsty734.9 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~trixie_arm64.deb
postgresql-17-pg-cardano1.2.1u22.x86_64pigsty952.1 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~jammy_amd64.deb
postgresql-17-pg-cardano1.2.1u22.aarch64pigsty865.7 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~jammy_arm64.deb
postgresql-17-pg-cardano1.2.1u24.x86_64pigsty948.2 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~noble_amd64.deb
postgresql-17-pg-cardano1.2.1u24.aarch64pigsty856.3 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~noble_arm64.deb
postgresql-17-pg-cardano1.2.1u26.x86_64pigsty937.2 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~resolute_amd64.deb
postgresql-17-pg-cardano1.2.1u26.aarch64pigsty852.8 KiBpostgresql-17-pg-cardano_1.2.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_cardano_161.2.1el8.x86_64pigsty1.0 MiBpg_cardano_16-1.2.1-1PGSTY.el8.x86_64.rpm
pg_cardano_161.2.1el8.aarch64pigsty917.5 KiBpg_cardano_16-1.2.1-1PGSTY.el8.aarch64.rpm
pg_cardano_161.2.1el9.x86_64pigsty1.0 MiBpg_cardano_16-1.2.1-1PGSTY.el9.x86_64.rpm
pg_cardano_161.2.1el9.aarch64pigsty979.6 KiBpg_cardano_16-1.2.1-1PGSTY.el9.aarch64.rpm
pg_cardano_161.2.1el10.x86_64pigsty1.0 MiBpg_cardano_16-1.2.1-1PGSTY.el10.x86_64.rpm
pg_cardano_161.2.1el10.aarch64pigsty981.4 KiBpg_cardano_16-1.2.1-1PGSTY.el10.aarch64.rpm
postgresql-16-pg-cardano1.2.1d12.x86_64pigsty857.7 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~bookworm_amd64.deb
postgresql-16-pg-cardano1.2.1d12.aarch64pigsty733.2 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~bookworm_arm64.deb
postgresql-16-pg-cardano1.2.1d13.x86_64pigsty857.9 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~trixie_amd64.deb
postgresql-16-pg-cardano1.2.1d13.aarch64pigsty734.1 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~trixie_arm64.deb
postgresql-16-pg-cardano1.2.1u22.x86_64pigsty951.5 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~jammy_amd64.deb
postgresql-16-pg-cardano1.2.1u22.aarch64pigsty864.6 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~jammy_arm64.deb
postgresql-16-pg-cardano1.2.1u24.x86_64pigsty947.3 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~noble_amd64.deb
postgresql-16-pg-cardano1.2.1u24.aarch64pigsty855.3 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~noble_arm64.deb
postgresql-16-pg-cardano1.2.1u26.x86_64pigsty935.8 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~resolute_amd64.deb
postgresql-16-pg-cardano1.2.1u26.aarch64pigsty851.4 KiBpostgresql-16-pg-cardano_1.2.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_cardano_151.2.1el8.x86_64pigsty1.0 MiBpg_cardano_15-1.2.1-1PGSTY.el8.x86_64.rpm
pg_cardano_151.2.1el8.aarch64pigsty912.3 KiBpg_cardano_15-1.2.1-1PGSTY.el8.aarch64.rpm
pg_cardano_151.2.1el9.x86_64pigsty1.0 MiBpg_cardano_15-1.2.1-1PGSTY.el9.x86_64.rpm
pg_cardano_151.2.1el9.aarch64pigsty974.8 KiBpg_cardano_15-1.2.1-1PGSTY.el9.aarch64.rpm
pg_cardano_151.2.1el10.x86_64pigsty1.0 MiBpg_cardano_15-1.2.1-1PGSTY.el10.x86_64.rpm
pg_cardano_151.2.1el10.aarch64pigsty975.2 KiBpg_cardano_15-1.2.1-1PGSTY.el10.aarch64.rpm
postgresql-15-pg-cardano1.2.1d12.x86_64pigsty855.4 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~bookworm_amd64.deb
postgresql-15-pg-cardano1.2.1d12.aarch64pigsty731.3 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~bookworm_arm64.deb
postgresql-15-pg-cardano1.2.1d13.x86_64pigsty855.1 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~trixie_amd64.deb
postgresql-15-pg-cardano1.2.1d13.aarch64pigsty732.1 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~trixie_arm64.deb
postgresql-15-pg-cardano1.2.1u22.x86_64pigsty947.1 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~jammy_amd64.deb
postgresql-15-pg-cardano1.2.1u22.aarch64pigsty861.8 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~jammy_arm64.deb
postgresql-15-pg-cardano1.2.1u24.x86_64pigsty943.9 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~noble_amd64.deb
postgresql-15-pg-cardano1.2.1u24.aarch64pigsty851.8 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~noble_arm64.deb
postgresql-15-pg-cardano1.2.1u26.x86_64pigsty932.4 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~resolute_amd64.deb
postgresql-15-pg-cardano1.2.1u26.aarch64pigsty849.0 KiBpostgresql-15-pg-cardano_1.2.1-1PGSTY~resolute_arm64.deb

Source

pig build pkg pg_cardano;		# 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_cardano;		# install by package name

pig install pg_cardano -v 19;   # install for PG 19
pig install pg_cardano -v 18;   # install for PG 18
pig install pg_cardano -v 17;   # install for PG 17
pig install pg_cardano -v 16;   # install for PG 16
pig install pg_cardano -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION pg_cardano;

Usage

Sources:

pg_cardano 1.2.2 provides Cardano-oriented binary and cryptographic functions from the cardano-community repository. This release documents PostgreSQL 15–19 and pgrx 0.20.1.

Core Workflow

Installation requires a superuser; the extension is non-relocatable and does not need preload. Its functions are exposed in the cardano schema.

CREATE EXTENSION pg_cardano;
SELECT cardano.base58_encode('Cardano'::bytea);
SELECT cardano.base58_decode('3Z6ioYHE3x');
SELECT cardano.bech32_encode('ada', 'is amazing'::bytea);
SELECT cardano.blake2b_hash('Cardano is amazing!'::bytea, 32);
SELECT cardano.cbor_decode_jsonb('\xa1616101'::bytea);
SELECT cardano.cbor_encode_jsonb('{"a": 1}'::jsonb);

Functions and Boundaries

The API covers Base58 and Bech32 encoding/decoding, CBOR and JSONB conversion, Blake2b hashing, Ed25519 signing/verification, CIP-105/CIP-129 dRep helpers, Shelley address construction/parsing, asset-name conversion and CIP-88 validation.

The simple CBOR conversion is intentionally lossy for some constructs. Use cardano.cbor_decode_jsonb_ext and cardano.cbor_encode_jsonb_ext with their documented typed JSON representation when structural preservation matters. Cryptographic functions do not provide key storage or access control; restrict sensitive inputs and application privileges separately.

Select binaries matching the PostgreSQL major and CPU architecture. Check the actual installed SQL update paths before updating an existing database; the same source version on two forks is not evidence that their installation files are interchangeable.

1.2.2 Verification Fixes

The release tightens CIP-88 pool-key authorization, pool identifiers, nonce validation, COSE witnesses and signed-payload checks, while processing CBOR natively in this path. Recheck application expectations for previously accepted malformed registrations. Install matching binaries; the supplied 1.2.1-to-1.2.2 SQL transition has no object changes.

ALTER EXTENSION pg_cardano UPDATE TO '1.2.2';

Table reader