Skip to content

pg_chainutils

Blockchain utility types and functions for PostgreSQL, built with pgrx.

pg_chainutils · Blockchain utility types and functions for PostgreSQL, built with pgrx.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100841pg_chainutilspg_chainutils0.2.4TYPEMITRust

PostgreSQL · 17

Usage

Sources:

pg_chainutils is a pgrx extension for parsing and transforming blockchain values inside PostgreSQL. It supplies Ethereum-style H160, H256, and U256 types and helpers for event topics and payloads, including ERC-20, ERC-721, Uniswap, Sushiswap, and related formats.

CREATE EXTENSION pg_chainutils;
SELECT H256.keccak256('Sync(uint112,uint112)');
SELECT H160.from_H256('0x0000000000000000000000001111111111111111111111111111111111111111');

Version 0.2.4 is built with pgrx and the reviewed manifest defaults to PostgreSQL 17. Input helpers expect exact ABI encodings; malformed lengths, prefixes, topic ordering, signedness, token decimals, and chain-specific conventions must be validated before ingestion. Treat decoded values as untrusted data and compare critical financial results with an independent decoder.

Table reader