hashtypes

hashtypes

hashtypes : sha1, md5 and other data types for PostgreSQL

Overview

ID Extension Package Version Category License Language
3750
hashtypes
hashtypes
0.1.5
TYPE
PostgreSQL
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d--
No
Yes
No
Yes
no
no
Relationships
See Also
prefix
semver
unit
pgpdf
pglite_fusion
md5hash
asn1oid
roaringbitmap

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
0.1.5
18
17
16
15
14
hashtypes -
RPM
PIGSTY
0.1.5
18
17
16
15
14
hashtypes_$v -
DEB
PIGSTY
0.1.5
18
17
16
15
14
postgresql-$v-hashtypes -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
el8.aarch64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
el9.x86_64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
el9.aarch64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
el10.x86_64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
el10.aarch64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
d12.x86_64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
d12.aarch64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
d13.x86_64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
d13.aarch64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
u22.x86_64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
u22.aarch64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
u24.x86_64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
u24.aarch64
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
PIGSTY 0.1.5
Package Version OS ORG SIZE File URL
hashtypes_18 0.1.5 el8.x86_64 pigsty 26.0 KiB hashtypes_18-0.1.5-1PIGSTY.el8.x86_64.rpm
hashtypes_18 0.1.5 el8.aarch64 pigsty 25.9 KiB hashtypes_18-0.1.5-1PIGSTY.el8.aarch64.rpm
hashtypes_18 0.1.5 el9.x86_64 pigsty 24.2 KiB hashtypes_18-0.1.5-1PIGSTY.el9.x86_64.rpm
hashtypes_18 0.1.5 el9.aarch64 pigsty 23.7 KiB hashtypes_18-0.1.5-1PIGSTY.el9.aarch64.rpm
hashtypes_18 0.1.5 el10.x86_64 pigsty 24.0 KiB hashtypes_18-0.1.5-1PIGSTY.el10.x86_64.rpm
hashtypes_18 0.1.5 el10.aarch64 pigsty 24.0 KiB hashtypes_18-0.1.5-1PIGSTY.el10.aarch64.rpm
postgresql-18-hashtypes 0.1.5 d12.x86_64 pigsty 33.5 KiB postgresql-18-hashtypes_0.1.5-1PIGSTY~bookworm_amd64.deb
postgresql-18-hashtypes 0.1.5 d12.aarch64 pigsty 33.5 KiB postgresql-18-hashtypes_0.1.5-1PIGSTY~bookworm_arm64.deb
postgresql-18-hashtypes 0.1.5 d13.x86_64 pigsty 33.5 KiB postgresql-18-hashtypes_0.1.5-1PIGSTY~trixie_amd64.deb
postgresql-18-hashtypes 0.1.5 d13.aarch64 pigsty 33.7 KiB postgresql-18-hashtypes_0.1.5-1PIGSTY~trixie_arm64.deb
postgresql-18-hashtypes 0.1.5 u22.x86_64 pigsty 35.8 KiB postgresql-18-hashtypes_0.1.5-1PIGSTY~jammy_amd64.deb
postgresql-18-hashtypes 0.1.5 u22.aarch64 pigsty 35.2 KiB postgresql-18-hashtypes_0.1.5-1PIGSTY~jammy_arm64.deb
postgresql-18-hashtypes 0.1.5 u24.x86_64 pigsty 35.0 KiB postgresql-18-hashtypes_0.1.5-1PIGSTY~noble_amd64.deb
postgresql-18-hashtypes 0.1.5 u24.aarch64 pigsty 35.1 KiB postgresql-18-hashtypes_0.1.5-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
hashtypes_17 0.1.5 el8.x86_64 pigsty 26.0 KiB hashtypes_17-0.1.5-1PIGSTY.el8.x86_64.rpm
hashtypes_17 0.1.5 el8.aarch64 pigsty 25.9 KiB hashtypes_17-0.1.5-1PIGSTY.el8.aarch64.rpm
hashtypes_17 0.1.5 el9.x86_64 pigsty 24.2 KiB hashtypes_17-0.1.5-1PIGSTY.el9.x86_64.rpm
hashtypes_17 0.1.5 el9.aarch64 pigsty 23.7 KiB hashtypes_17-0.1.5-1PIGSTY.el9.aarch64.rpm
hashtypes_17 0.1.5 el10.x86_64 pigsty 24.0 KiB hashtypes_17-0.1.5-1PIGSTY.el10.x86_64.rpm
hashtypes_17 0.1.5 el10.aarch64 pigsty 24.0 KiB hashtypes_17-0.1.5-1PIGSTY.el10.aarch64.rpm
postgresql-17-hashtypes 0.1.5 d12.x86_64 pigsty 33.5 KiB postgresql-17-hashtypes_0.1.5-1PIGSTY~bookworm_amd64.deb
postgresql-17-hashtypes 0.1.5 d12.aarch64 pigsty 33.5 KiB postgresql-17-hashtypes_0.1.5-1PIGSTY~bookworm_arm64.deb
postgresql-17-hashtypes 0.1.5 d13.x86_64 pigsty 33.6 KiB postgresql-17-hashtypes_0.1.5-1PIGSTY~trixie_amd64.deb
postgresql-17-hashtypes 0.1.5 d13.aarch64 pigsty 33.6 KiB postgresql-17-hashtypes_0.1.5-1PIGSTY~trixie_arm64.deb
postgresql-17-hashtypes 0.1.5 u22.x86_64 pigsty 36.4 KiB postgresql-17-hashtypes_0.1.5-1PIGSTY~jammy_amd64.deb
postgresql-17-hashtypes 0.1.5 u22.aarch64 pigsty 35.9 KiB postgresql-17-hashtypes_0.1.5-1PIGSTY~jammy_arm64.deb
postgresql-17-hashtypes 0.1.5 u24.x86_64 pigsty 35.0 KiB postgresql-17-hashtypes_0.1.5-1PIGSTY~noble_amd64.deb
postgresql-17-hashtypes 0.1.5 u24.aarch64 pigsty 35.2 KiB postgresql-17-hashtypes_0.1.5-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
hashtypes_16 0.1.5 el8.x86_64 pigsty 26.0 KiB hashtypes_16-0.1.5-1PIGSTY.el8.x86_64.rpm
hashtypes_16 0.1.5 el8.aarch64 pigsty 25.9 KiB hashtypes_16-0.1.5-1PIGSTY.el8.aarch64.rpm
hashtypes_16 0.1.5 el9.x86_64 pigsty 24.2 KiB hashtypes_16-0.1.5-1PIGSTY.el9.x86_64.rpm
hashtypes_16 0.1.5 el9.aarch64 pigsty 23.7 KiB hashtypes_16-0.1.5-1PIGSTY.el9.aarch64.rpm
hashtypes_16 0.1.5 el10.x86_64 pigsty 24.0 KiB hashtypes_16-0.1.5-1PIGSTY.el10.x86_64.rpm
hashtypes_16 0.1.5 el10.aarch64 pigsty 24.0 KiB hashtypes_16-0.1.5-1PIGSTY.el10.aarch64.rpm
postgresql-16-hashtypes 0.1.5 d12.x86_64 pigsty 33.5 KiB postgresql-16-hashtypes_0.1.5-1PIGSTY~bookworm_amd64.deb
postgresql-16-hashtypes 0.1.5 d12.aarch64 pigsty 33.4 KiB postgresql-16-hashtypes_0.1.5-1PIGSTY~bookworm_arm64.deb
postgresql-16-hashtypes 0.1.5 d13.x86_64 pigsty 33.5 KiB postgresql-16-hashtypes_0.1.5-1PIGSTY~trixie_amd64.deb
postgresql-16-hashtypes 0.1.5 d13.aarch64 pigsty 33.6 KiB postgresql-16-hashtypes_0.1.5-1PIGSTY~trixie_arm64.deb
postgresql-16-hashtypes 0.1.5 u22.x86_64 pigsty 36.4 KiB postgresql-16-hashtypes_0.1.5-1PIGSTY~jammy_amd64.deb
postgresql-16-hashtypes 0.1.5 u22.aarch64 pigsty 35.9 KiB postgresql-16-hashtypes_0.1.5-1PIGSTY~jammy_arm64.deb
postgresql-16-hashtypes 0.1.5 u24.x86_64 pigsty 35.0 KiB postgresql-16-hashtypes_0.1.5-1PIGSTY~noble_amd64.deb
postgresql-16-hashtypes 0.1.5 u24.aarch64 pigsty 35.0 KiB postgresql-16-hashtypes_0.1.5-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
hashtypes_15 0.1.5 el8.x86_64 pigsty 26.0 KiB hashtypes_15-0.1.5-1PIGSTY.el8.x86_64.rpm
hashtypes_15 0.1.5 el8.aarch64 pigsty 25.9 KiB hashtypes_15-0.1.5-1PIGSTY.el8.aarch64.rpm
hashtypes_15 0.1.5 el9.x86_64 pigsty 24.3 KiB hashtypes_15-0.1.5-1PIGSTY.el9.x86_64.rpm
hashtypes_15 0.1.5 el9.aarch64 pigsty 24.0 KiB hashtypes_15-0.1.5-1PIGSTY.el9.aarch64.rpm
hashtypes_15 0.1.5 el10.x86_64 pigsty 24.2 KiB hashtypes_15-0.1.5-1PIGSTY.el10.x86_64.rpm
hashtypes_15 0.1.5 el10.aarch64 pigsty 24.2 KiB hashtypes_15-0.1.5-1PIGSTY.el10.aarch64.rpm
postgresql-15-hashtypes 0.1.5 d12.x86_64 pigsty 33.5 KiB postgresql-15-hashtypes_0.1.5-1PIGSTY~bookworm_amd64.deb
postgresql-15-hashtypes 0.1.5 d12.aarch64 pigsty 33.5 KiB postgresql-15-hashtypes_0.1.5-1PIGSTY~bookworm_arm64.deb
postgresql-15-hashtypes 0.1.5 d13.x86_64 pigsty 33.6 KiB postgresql-15-hashtypes_0.1.5-1PIGSTY~trixie_amd64.deb
postgresql-15-hashtypes 0.1.5 d13.aarch64 pigsty 33.5 KiB postgresql-15-hashtypes_0.1.5-1PIGSTY~trixie_arm64.deb
postgresql-15-hashtypes 0.1.5 u22.x86_64 pigsty 36.7 KiB postgresql-15-hashtypes_0.1.5-1PIGSTY~jammy_amd64.deb
postgresql-15-hashtypes 0.1.5 u22.aarch64 pigsty 36.1 KiB postgresql-15-hashtypes_0.1.5-1PIGSTY~jammy_arm64.deb
postgresql-15-hashtypes 0.1.5 u24.x86_64 pigsty 35.1 KiB postgresql-15-hashtypes_0.1.5-1PIGSTY~noble_amd64.deb
postgresql-15-hashtypes 0.1.5 u24.aarch64 pigsty 35.0 KiB postgresql-15-hashtypes_0.1.5-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
hashtypes_14 0.1.5 el8.x86_64 pigsty 26.0 KiB hashtypes_14-0.1.5-1PIGSTY.el8.x86_64.rpm
hashtypes_14 0.1.5 el8.aarch64 pigsty 25.9 KiB hashtypes_14-0.1.5-1PIGSTY.el8.aarch64.rpm
hashtypes_14 0.1.5 el9.x86_64 pigsty 24.2 KiB hashtypes_14-0.1.5-1PIGSTY.el9.x86_64.rpm
hashtypes_14 0.1.5 el9.aarch64 pigsty 24.0 KiB hashtypes_14-0.1.5-1PIGSTY.el9.aarch64.rpm
hashtypes_14 0.1.5 el10.x86_64 pigsty 24.2 KiB hashtypes_14-0.1.5-1PIGSTY.el10.x86_64.rpm
hashtypes_14 0.1.5 el10.aarch64 pigsty 24.2 KiB hashtypes_14-0.1.5-1PIGSTY.el10.aarch64.rpm
postgresql-14-hashtypes 0.1.5 d12.x86_64 pigsty 33.5 KiB postgresql-14-hashtypes_0.1.5-1PIGSTY~bookworm_amd64.deb
postgresql-14-hashtypes 0.1.5 d12.aarch64 pigsty 33.4 KiB postgresql-14-hashtypes_0.1.5-1PIGSTY~bookworm_arm64.deb
postgresql-14-hashtypes 0.1.5 d13.x86_64 pigsty 33.6 KiB postgresql-14-hashtypes_0.1.5-1PIGSTY~trixie_amd64.deb
postgresql-14-hashtypes 0.1.5 d13.aarch64 pigsty 33.4 KiB postgresql-14-hashtypes_0.1.5-1PIGSTY~trixie_arm64.deb
postgresql-14-hashtypes 0.1.5 u22.x86_64 pigsty 36.7 KiB postgresql-14-hashtypes_0.1.5-1PIGSTY~jammy_amd64.deb
postgresql-14-hashtypes 0.1.5 u22.aarch64 pigsty 36.0 KiB postgresql-14-hashtypes_0.1.5-1PIGSTY~jammy_arm64.deb
postgresql-14-hashtypes 0.1.5 u24.x86_64 pigsty 34.9 KiB postgresql-14-hashtypes_0.1.5-1PIGSTY~noble_amd64.deb
postgresql-14-hashtypes 0.1.5 u24.aarch64 pigsty 35.0 KiB postgresql-14-hashtypes_0.1.5-1PIGSTY~noble_arm64.deb

Source

pig build pkg hashtypes;		# 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 hashtypes;		# install via package name, for the active PG version

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

Create this extension with:

CREATE EXTENSION hashtypes;

Usage

hashtypes: hash and checksum data types (SHA, CRC32)

The hashtypes extension provides native data types for storing hash values and checksums in their binary representation, saving storage compared to text.

CREATE EXTENSION hashtypes;

Data Types

Type Storage Description
sha1 20 bytes SHA-1 hash (160-bit)
sha224 28 bytes SHA-224 hash (224-bit)
sha256 32 bytes SHA-256 hash (256-bit)
sha384 48 bytes SHA-384 hash (384-bit)
sha512 64 bytes SHA-512 hash (512-bit)
crc32 4 bytes CRC-32 checksum

Usage

CREATE TABLE objects (
    hash sha256 PRIMARY KEY,
    data bytea
);

INSERT INTO objects VALUES (
    'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
    '\x'
);

SELECT * FROM objects WHERE hash = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';

Operators

All types support comparison operators: =, <>, <, >, <=, >=.

Index Support

Btree and hash index operator classes are provided for all types.

Casts

All types support bidirectional casts to/from text and bytea.

Last updated on