Skip to content

md5hash

type for storing 128-bit binary data inline

md5hash · type for storing 128-bit binary data inline

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
3610md5hashmd5hash1.0.1TYPEBSD-2-ClauseC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.0.119 18 17 16 15md5hash-
RPMPIGSTY1.0.119 18 17 16 15md5hash_$v-
DEBPIGSTY1.0.119 18 17 16 15postgresql-$v-md5hash-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
el8.aarch64N/APIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
el9.x86_64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
el9.aarch64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
el10.x86_64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
el10.aarch64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
d12.x86_64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
d12.aarch64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
d13.x86_64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
d13.aarch64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
u22.x86_64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
u22.aarch64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
u24.x86_64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
u24.aarch64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
u26.x86_64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
u26.aarch64PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1PIGSTY 1.0.1
PackageVersionOSORGSIZEFile URL
md5hash_191.0.1el9.x86_64pigsty21.7 KiBmd5hash_19-1.0.1-1PGSTY.el9.x86_64.rpm
md5hash_191.0.1el9.aarch64pigsty22.0 KiBmd5hash_19-1.0.1-1PGSTY.el9.aarch64.rpm
md5hash_191.0.1el10.x86_64pigsty21.9 KiBmd5hash_19-1.0.1-1PGSTY.el10.x86_64.rpm
md5hash_191.0.1el10.aarch64pigsty22.1 KiBmd5hash_19-1.0.1-1PGSTY.el10.aarch64.rpm
postgresql-19-md5hash1.0.1d12.x86_64pigsty13.6 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~bookworm_amd64.deb
postgresql-19-md5hash1.0.1d12.aarch64pigsty13.7 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~bookworm_arm64.deb
postgresql-19-md5hash1.0.1d13.x86_64pigsty13.6 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~trixie_amd64.deb
postgresql-19-md5hash1.0.1d13.aarch64pigsty13.8 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~trixie_arm64.deb
postgresql-19-md5hash1.0.1u22.x86_64pigsty14.3 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~jammy_amd64.deb
postgresql-19-md5hash1.0.1u22.aarch64pigsty14.5 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~jammy_arm64.deb
postgresql-19-md5hash1.0.1u24.x86_64pigsty14.4 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~noble_amd64.deb
postgresql-19-md5hash1.0.1u24.aarch64pigsty14.3 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~noble_arm64.deb
postgresql-19-md5hash1.0.1u26.x86_64pigsty14.5 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~resolute_amd64.deb
postgresql-19-md5hash1.0.1u26.aarch64pigsty14.7 KiBpostgresql-19-md5hash_1.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
md5hash_181.0.1el8.x86_64pigsty21.5 KiBmd5hash_18-1.0.1-1PGSTY.el8.x86_64.rpm
md5hash_181.0.1el8.aarch64pigsty21.9 KiBmd5hash_18-1.0.1-1PGSTY.el8.aarch64.rpm
md5hash_181.0.1el9.x86_64pigsty21.6 KiBmd5hash_18-1.0.1-1PGSTY.el9.x86_64.rpm
md5hash_181.0.1el9.aarch64pigsty22.0 KiBmd5hash_18-1.0.1-1PGSTY.el9.aarch64.rpm
md5hash_181.0.1el10.x86_64pigsty21.8 KiBmd5hash_18-1.0.1-1PGSTY.el10.x86_64.rpm
md5hash_181.0.1el10.aarch64pigsty22.1 KiBmd5hash_18-1.0.1-1PGSTY.el10.aarch64.rpm
postgresql-18-md5hash1.0.1d12.x86_64pigsty13.6 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~bookworm_amd64.deb
postgresql-18-md5hash1.0.1d12.aarch64pigsty13.7 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~bookworm_arm64.deb
postgresql-18-md5hash1.0.1d13.x86_64pigsty13.6 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~trixie_amd64.deb
postgresql-18-md5hash1.0.1d13.aarch64pigsty13.8 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~trixie_arm64.deb
postgresql-18-md5hash1.0.1u22.x86_64pigsty14.3 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~jammy_amd64.deb
postgresql-18-md5hash1.0.1u22.aarch64pigsty14.5 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~jammy_arm64.deb
postgresql-18-md5hash1.0.1u24.x86_64pigsty14.4 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~noble_amd64.deb
postgresql-18-md5hash1.0.1u24.aarch64pigsty14.3 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~noble_arm64.deb
postgresql-18-md5hash1.0.1u26.x86_64pigsty14.5 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~resolute_amd64.deb
postgresql-18-md5hash1.0.1u26.aarch64pigsty14.6 KiBpostgresql-18-md5hash_1.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
md5hash_171.0.1el8.x86_64pigsty21.4 KiBmd5hash_17-1.0.1-1PGSTY.el8.x86_64.rpm
md5hash_171.0.1el8.aarch64pigsty21.9 KiBmd5hash_17-1.0.1-1PGSTY.el8.aarch64.rpm
md5hash_171.0.1el9.x86_64pigsty21.6 KiBmd5hash_17-1.0.1-1PGSTY.el9.x86_64.rpm
md5hash_171.0.1el9.aarch64pigsty22.0 KiBmd5hash_17-1.0.1-1PGSTY.el9.aarch64.rpm
md5hash_171.0.1el10.x86_64pigsty21.8 KiBmd5hash_17-1.0.1-1PGSTY.el10.x86_64.rpm
md5hash_171.0.1el10.aarch64pigsty22.1 KiBmd5hash_17-1.0.1-1PGSTY.el10.aarch64.rpm
postgresql-17-md5hash1.0.1d12.x86_64pigsty13.6 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~bookworm_amd64.deb
postgresql-17-md5hash1.0.1d12.aarch64pigsty13.7 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~bookworm_arm64.deb
postgresql-17-md5hash1.0.1d13.x86_64pigsty13.6 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~trixie_amd64.deb
postgresql-17-md5hash1.0.1d13.aarch64pigsty13.7 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~trixie_arm64.deb
postgresql-17-md5hash1.0.1u22.x86_64pigsty14.5 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~jammy_amd64.deb
postgresql-17-md5hash1.0.1u22.aarch64pigsty14.7 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~jammy_arm64.deb
postgresql-17-md5hash1.0.1u24.x86_64pigsty14.4 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~noble_amd64.deb
postgresql-17-md5hash1.0.1u24.aarch64pigsty14.3 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~noble_arm64.deb
postgresql-17-md5hash1.0.1u26.x86_64pigsty14.5 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~resolute_amd64.deb
postgresql-17-md5hash1.0.1u26.aarch64pigsty14.6 KiBpostgresql-17-md5hash_1.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
md5hash_161.0.1el8.x86_64pigsty21.4 KiBmd5hash_16-1.0.1-1PGSTY.el8.x86_64.rpm
md5hash_161.0.1el8.aarch64pigsty21.9 KiBmd5hash_16-1.0.1-1PGSTY.el8.aarch64.rpm
md5hash_161.0.1el9.x86_64pigsty21.6 KiBmd5hash_16-1.0.1-1PGSTY.el9.x86_64.rpm
md5hash_161.0.1el9.aarch64pigsty22.0 KiBmd5hash_16-1.0.1-1PGSTY.el9.aarch64.rpm
md5hash_161.0.1el10.x86_64pigsty21.8 KiBmd5hash_16-1.0.1-1PGSTY.el10.x86_64.rpm
md5hash_161.0.1el10.aarch64pigsty22.1 KiBmd5hash_16-1.0.1-1PGSTY.el10.aarch64.rpm
postgresql-16-md5hash1.0.1d12.x86_64pigsty13.6 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~bookworm_amd64.deb
postgresql-16-md5hash1.0.1d12.aarch64pigsty13.7 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~bookworm_arm64.deb
postgresql-16-md5hash1.0.1d13.x86_64pigsty13.6 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~trixie_amd64.deb
postgresql-16-md5hash1.0.1d13.aarch64pigsty13.7 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~trixie_arm64.deb
postgresql-16-md5hash1.0.1u22.x86_64pigsty14.5 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~jammy_amd64.deb
postgresql-16-md5hash1.0.1u22.aarch64pigsty14.7 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~jammy_arm64.deb
postgresql-16-md5hash1.0.1u24.x86_64pigsty14.4 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~noble_amd64.deb
postgresql-16-md5hash1.0.1u24.aarch64pigsty14.3 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~noble_arm64.deb
postgresql-16-md5hash1.0.1u26.x86_64pigsty14.5 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~resolute_amd64.deb
postgresql-16-md5hash1.0.1u26.aarch64pigsty14.6 KiBpostgresql-16-md5hash_1.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
md5hash_151.0.1el8.x86_64pigsty21.4 KiBmd5hash_15-1.0.1-1PGSTY.el8.x86_64.rpm
md5hash_151.0.1el8.aarch64pigsty21.9 KiBmd5hash_15-1.0.1-1PGSTY.el8.aarch64.rpm
md5hash_151.0.1el9.x86_64pigsty21.6 KiBmd5hash_15-1.0.1-1PGSTY.el9.x86_64.rpm
md5hash_151.0.1el9.aarch64pigsty22.0 KiBmd5hash_15-1.0.1-1PGSTY.el9.aarch64.rpm
md5hash_151.0.1el10.x86_64pigsty21.8 KiBmd5hash_15-1.0.1-1PGSTY.el10.x86_64.rpm
md5hash_151.0.1el10.aarch64pigsty22.1 KiBmd5hash_15-1.0.1-1PGSTY.el10.aarch64.rpm
postgresql-15-md5hash1.0.1d12.x86_64pigsty13.6 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~bookworm_amd64.deb
postgresql-15-md5hash1.0.1d12.aarch64pigsty13.7 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~bookworm_arm64.deb
postgresql-15-md5hash1.0.1d13.x86_64pigsty13.6 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~trixie_amd64.deb
postgresql-15-md5hash1.0.1d13.aarch64pigsty13.7 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~trixie_arm64.deb
postgresql-15-md5hash1.0.1u22.x86_64pigsty14.5 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~jammy_amd64.deb
postgresql-15-md5hash1.0.1u22.aarch64pigsty14.7 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~jammy_arm64.deb
postgresql-15-md5hash1.0.1u24.x86_64pigsty14.4 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~noble_amd64.deb
postgresql-15-md5hash1.0.1u24.aarch64pigsty14.3 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~noble_arm64.deb
postgresql-15-md5hash1.0.1u26.x86_64pigsty14.5 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~resolute_amd64.deb
postgresql-15-md5hash1.0.1u26.aarch64pigsty14.6 KiBpostgresql-15-md5hash_1.0.1-1PGSTY~resolute_arm64.deb

Source

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

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

Create this extension with:

CREATE EXTENSION md5hash;

Usage

md5hash: native MD5 hash data type for PostgreSQL

The md5hash extension provides an efficient 128-bit data type for storing MD5 hashes in binary format (16 bytes) instead of text (32+ bytes).

CREATE EXTENSION md5hash;

CREATE TABLE test_table (
    id md5hash PRIMARY KEY
);

INSERT INTO test_table VALUES ('c4ca4238a0b923820dcc509a6f75849b');

SELECT * FROM test_table
WHERE id = 'c4ca4238a0b923820dcc509a6f75849b';

Operators

Standard comparison operators are supported: =, <>, <, >, <=, >=.

Index Support

Btree index operator class is included, enabling efficient lookups and primary key constraints on md5hash columns.

Storage Benefits

Compared to storing MD5 as text, the md5hash type uses approximately 60% of the storage space and provides faster indexed lookups.

Table reader