byteamagic

byteamagic

pg_byteamagic : Detect MIME types and file formats from PostgreSQL bytea values

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4275
byteamagic
pg_byteamagic
0.2.4
UTIL
BSD 2-Clause
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-r
No
Yes
No
Yes
yes
no

Extension name is byteamagic; package name is pg_byteamagic.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PIGSTY
0.2.4
18
17
16
15
14
pg_byteamagic-
RPM
PIGSTY
0.2.4
18
17
16
15
14
pg_byteamagic_$v-
DEB
PIGSTY
0.2.4
18
17
16
15
14
postgresql-$v-pg-byteamagic-
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el8.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el9.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el9.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el10.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
el10.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
d12.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
d12.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
d13.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
d13.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
u22.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
u22.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
u24.x86_64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
u24.aarch64
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PIGSTY 0.2.4
PackageVersionOSORGSIZEFile URL
pg_byteamagic_180.2.4el8.x86_64pigsty13.8 KiBpg_byteamagic_18-0.2.4-1PIGSTY.el8.x86_64.rpm
pg_byteamagic_180.2.4el8.aarch64pigsty13.9 KiBpg_byteamagic_18-0.2.4-1PIGSTY.el8.aarch64.rpm
pg_byteamagic_180.2.4el9.x86_64pigsty13.8 KiBpg_byteamagic_18-0.2.4-1PIGSTY.el9.x86_64.rpm
pg_byteamagic_180.2.4el9.aarch64pigsty13.6 KiBpg_byteamagic_18-0.2.4-1PIGSTY.el9.aarch64.rpm
pg_byteamagic_180.2.4el10.x86_64pigsty13.8 KiBpg_byteamagic_18-0.2.4-1PIGSTY.el10.x86_64.rpm
pg_byteamagic_180.2.4el10.aarch64pigsty13.9 KiBpg_byteamagic_18-0.2.4-1PIGSTY.el10.aarch64.rpm
postgresql-18-pg-byteamagic0.2.4d12.x86_64pigsty10.5 KiBpostgresql-18-pg-byteamagic_0.2.4-1PIGSTY~bookworm_amd64.deb
postgresql-18-pg-byteamagic0.2.4d12.aarch64pigsty10.7 KiBpostgresql-18-pg-byteamagic_0.2.4-1PIGSTY~bookworm_arm64.deb
postgresql-18-pg-byteamagic0.2.4d13.x86_64pigsty10.7 KiBpostgresql-18-pg-byteamagic_0.2.4-1PIGSTY~trixie_amd64.deb
postgresql-18-pg-byteamagic0.2.4d13.aarch64pigsty10.6 KiBpostgresql-18-pg-byteamagic_0.2.4-1PIGSTY~trixie_arm64.deb
postgresql-18-pg-byteamagic0.2.4u22.x86_64pigsty10.7 KiBpostgresql-18-pg-byteamagic_0.2.4-1PIGSTY~jammy_amd64.deb
postgresql-18-pg-byteamagic0.2.4u22.aarch64pigsty10.6 KiBpostgresql-18-pg-byteamagic_0.2.4-1PIGSTY~jammy_arm64.deb
postgresql-18-pg-byteamagic0.2.4u24.x86_64pigsty10.7 KiBpostgresql-18-pg-byteamagic_0.2.4-1PIGSTY~noble_amd64.deb
postgresql-18-pg-byteamagic0.2.4u24.aarch64pigsty10.8 KiBpostgresql-18-pg-byteamagic_0.2.4-1PIGSTY~noble_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_byteamagic_170.2.4el8.x86_64pigsty13.8 KiBpg_byteamagic_17-0.2.4-1PIGSTY.el8.x86_64.rpm
pg_byteamagic_170.2.4el8.aarch64pigsty13.9 KiBpg_byteamagic_17-0.2.4-1PIGSTY.el8.aarch64.rpm
pg_byteamagic_170.2.4el9.x86_64pigsty13.8 KiBpg_byteamagic_17-0.2.4-1PIGSTY.el9.x86_64.rpm
pg_byteamagic_170.2.4el9.aarch64pigsty13.6 KiBpg_byteamagic_17-0.2.4-1PIGSTY.el9.aarch64.rpm
pg_byteamagic_170.2.4el10.x86_64pigsty13.8 KiBpg_byteamagic_17-0.2.4-1PIGSTY.el10.x86_64.rpm
pg_byteamagic_170.2.4el10.aarch64pigsty13.9 KiBpg_byteamagic_17-0.2.4-1PIGSTY.el10.aarch64.rpm
postgresql-17-pg-byteamagic0.2.4d12.x86_64pigsty10.5 KiBpostgresql-17-pg-byteamagic_0.2.4-1PIGSTY~bookworm_amd64.deb
postgresql-17-pg-byteamagic0.2.4d12.aarch64pigsty10.7 KiBpostgresql-17-pg-byteamagic_0.2.4-1PIGSTY~bookworm_arm64.deb
postgresql-17-pg-byteamagic0.2.4d13.x86_64pigsty10.7 KiBpostgresql-17-pg-byteamagic_0.2.4-1PIGSTY~trixie_amd64.deb
postgresql-17-pg-byteamagic0.2.4d13.aarch64pigsty10.7 KiBpostgresql-17-pg-byteamagic_0.2.4-1PIGSTY~trixie_arm64.deb
postgresql-17-pg-byteamagic0.2.4u22.x86_64pigsty10.9 KiBpostgresql-17-pg-byteamagic_0.2.4-1PIGSTY~jammy_amd64.deb
postgresql-17-pg-byteamagic0.2.4u22.aarch64pigsty10.8 KiBpostgresql-17-pg-byteamagic_0.2.4-1PIGSTY~jammy_arm64.deb
postgresql-17-pg-byteamagic0.2.4u24.x86_64pigsty10.7 KiBpostgresql-17-pg-byteamagic_0.2.4-1PIGSTY~noble_amd64.deb
postgresql-17-pg-byteamagic0.2.4u24.aarch64pigsty10.8 KiBpostgresql-17-pg-byteamagic_0.2.4-1PIGSTY~noble_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_byteamagic_160.2.4el8.x86_64pigsty13.8 KiBpg_byteamagic_16-0.2.4-1PIGSTY.el8.x86_64.rpm
pg_byteamagic_160.2.4el8.aarch64pigsty13.9 KiBpg_byteamagic_16-0.2.4-1PIGSTY.el8.aarch64.rpm
pg_byteamagic_160.2.4el9.x86_64pigsty13.8 KiBpg_byteamagic_16-0.2.4-1PIGSTY.el9.x86_64.rpm
pg_byteamagic_160.2.4el9.aarch64pigsty13.6 KiBpg_byteamagic_16-0.2.4-1PIGSTY.el9.aarch64.rpm
pg_byteamagic_160.2.4el10.x86_64pigsty13.8 KiBpg_byteamagic_16-0.2.4-1PIGSTY.el10.x86_64.rpm
pg_byteamagic_160.2.4el10.aarch64pigsty13.9 KiBpg_byteamagic_16-0.2.4-1PIGSTY.el10.aarch64.rpm
postgresql-16-pg-byteamagic0.2.4d12.x86_64pigsty10.5 KiBpostgresql-16-pg-byteamagic_0.2.4-1PIGSTY~bookworm_amd64.deb
postgresql-16-pg-byteamagic0.2.4d12.aarch64pigsty10.7 KiBpostgresql-16-pg-byteamagic_0.2.4-1PIGSTY~bookworm_arm64.deb
postgresql-16-pg-byteamagic0.2.4d13.x86_64pigsty10.7 KiBpostgresql-16-pg-byteamagic_0.2.4-1PIGSTY~trixie_amd64.deb
postgresql-16-pg-byteamagic0.2.4d13.aarch64pigsty10.6 KiBpostgresql-16-pg-byteamagic_0.2.4-1PIGSTY~trixie_arm64.deb
postgresql-16-pg-byteamagic0.2.4u22.x86_64pigsty10.9 KiBpostgresql-16-pg-byteamagic_0.2.4-1PIGSTY~jammy_amd64.deb
postgresql-16-pg-byteamagic0.2.4u22.aarch64pigsty10.8 KiBpostgresql-16-pg-byteamagic_0.2.4-1PIGSTY~jammy_arm64.deb
postgresql-16-pg-byteamagic0.2.4u24.x86_64pigsty10.7 KiBpostgresql-16-pg-byteamagic_0.2.4-1PIGSTY~noble_amd64.deb
postgresql-16-pg-byteamagic0.2.4u24.aarch64pigsty10.9 KiBpostgresql-16-pg-byteamagic_0.2.4-1PIGSTY~noble_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_byteamagic_150.2.4el8.x86_64pigsty13.8 KiBpg_byteamagic_15-0.2.4-1PIGSTY.el8.x86_64.rpm
pg_byteamagic_150.2.4el8.aarch64pigsty13.9 KiBpg_byteamagic_15-0.2.4-1PIGSTY.el8.aarch64.rpm
pg_byteamagic_150.2.4el9.x86_64pigsty13.8 KiBpg_byteamagic_15-0.2.4-1PIGSTY.el9.x86_64.rpm
pg_byteamagic_150.2.4el9.aarch64pigsty13.6 KiBpg_byteamagic_15-0.2.4-1PIGSTY.el9.aarch64.rpm
pg_byteamagic_150.2.4el10.x86_64pigsty13.8 KiBpg_byteamagic_15-0.2.4-1PIGSTY.el10.x86_64.rpm
pg_byteamagic_150.2.4el10.aarch64pigsty13.9 KiBpg_byteamagic_15-0.2.4-1PIGSTY.el10.aarch64.rpm
postgresql-15-pg-byteamagic0.2.4d12.x86_64pigsty10.5 KiBpostgresql-15-pg-byteamagic_0.2.4-1PIGSTY~bookworm_amd64.deb
postgresql-15-pg-byteamagic0.2.4d12.aarch64pigsty10.7 KiBpostgresql-15-pg-byteamagic_0.2.4-1PIGSTY~bookworm_arm64.deb
postgresql-15-pg-byteamagic0.2.4d13.x86_64pigsty10.7 KiBpostgresql-15-pg-byteamagic_0.2.4-1PIGSTY~trixie_amd64.deb
postgresql-15-pg-byteamagic0.2.4d13.aarch64pigsty10.6 KiBpostgresql-15-pg-byteamagic_0.2.4-1PIGSTY~trixie_arm64.deb
postgresql-15-pg-byteamagic0.2.4u22.x86_64pigsty10.9 KiBpostgresql-15-pg-byteamagic_0.2.4-1PIGSTY~jammy_amd64.deb
postgresql-15-pg-byteamagic0.2.4u22.aarch64pigsty10.8 KiBpostgresql-15-pg-byteamagic_0.2.4-1PIGSTY~jammy_arm64.deb
postgresql-15-pg-byteamagic0.2.4u24.x86_64pigsty10.7 KiBpostgresql-15-pg-byteamagic_0.2.4-1PIGSTY~noble_amd64.deb
postgresql-15-pg-byteamagic0.2.4u24.aarch64pigsty10.8 KiBpostgresql-15-pg-byteamagic_0.2.4-1PIGSTY~noble_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_byteamagic_140.2.4el8.x86_64pigsty13.8 KiBpg_byteamagic_14-0.2.4-1PIGSTY.el8.x86_64.rpm
pg_byteamagic_140.2.4el8.aarch64pigsty13.9 KiBpg_byteamagic_14-0.2.4-1PIGSTY.el8.aarch64.rpm
pg_byteamagic_140.2.4el9.x86_64pigsty13.8 KiBpg_byteamagic_14-0.2.4-1PIGSTY.el9.x86_64.rpm
pg_byteamagic_140.2.4el9.aarch64pigsty13.6 KiBpg_byteamagic_14-0.2.4-1PIGSTY.el9.aarch64.rpm
pg_byteamagic_140.2.4el10.x86_64pigsty13.8 KiBpg_byteamagic_14-0.2.4-1PIGSTY.el10.x86_64.rpm
pg_byteamagic_140.2.4el10.aarch64pigsty13.9 KiBpg_byteamagic_14-0.2.4-1PIGSTY.el10.aarch64.rpm
postgresql-14-pg-byteamagic0.2.4d12.x86_64pigsty10.5 KiBpostgresql-14-pg-byteamagic_0.2.4-1PIGSTY~bookworm_amd64.deb
postgresql-14-pg-byteamagic0.2.4d12.aarch64pigsty10.7 KiBpostgresql-14-pg-byteamagic_0.2.4-1PIGSTY~bookworm_arm64.deb
postgresql-14-pg-byteamagic0.2.4d13.x86_64pigsty10.6 KiBpostgresql-14-pg-byteamagic_0.2.4-1PIGSTY~trixie_amd64.deb
postgresql-14-pg-byteamagic0.2.4d13.aarch64pigsty10.6 KiBpostgresql-14-pg-byteamagic_0.2.4-1PIGSTY~trixie_arm64.deb
postgresql-14-pg-byteamagic0.2.4u22.x86_64pigsty10.9 KiBpostgresql-14-pg-byteamagic_0.2.4-1PIGSTY~jammy_amd64.deb
postgresql-14-pg-byteamagic0.2.4u22.aarch64pigsty10.8 KiBpostgresql-14-pg-byteamagic_0.2.4-1PIGSTY~jammy_arm64.deb
postgresql-14-pg-byteamagic0.2.4u24.x86_64pigsty10.7 KiBpostgresql-14-pg-byteamagic_0.2.4-1PIGSTY~noble_amd64.deb
postgresql-14-pg-byteamagic0.2.4u24.aarch64pigsty10.8 KiBpostgresql-14-pg-byteamagic_0.2.4-1PIGSTY~noble_arm64.deb

Source

pig build pkg pg_byteamagic;		# 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_byteamagic;		# install via package name, for the active PG version
pig install byteamagic;		# install by extension name, for the current active PG version

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

Create this extension with:

CREATE EXTENSION byteamagic;

Usage

Sources: GitHub repo, byteamagic docs Extension name: byteamagic The CSV package row is pg_byteamagic; the upstream extension name is byteamagic.

byteamagic uses libmagic on bytea values to identify the MIME type and the file type text inside PostgreSQL.

CREATE EXTENSION byteamagic;
SELECT byteamagic_mime(data);
SELECT byteamagic_text(data);

Functions

  • byteamagic_mime(bytea) returns the MIME type as text and matches file --mime-type.
  • byteamagic_text(bytea) returns a human-readable file type description and matches file.

Notes

  • The extension needs PostgreSQL development headers and the libmagic development package.
  • It is intended for databases that store files or blobs in bytea and need in-database type detection.
Last updated on