byteamagic
Detect MIME types and file formats from PostgreSQL bytea values
Repository
nmandery/pg_byteamagic
https://github.com/nmandery/pg_byteamagic
Source
pg_byteamagic-0.2.4.tar.gz
pg_byteamagic-0.2.4.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_byteamagic | 0.2.4 | UTIL | BSD-2-Clause | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4275 | byteamagic | No | Yes | No | Yes | No | Yes | - |
Extension name is byteamagic; package name is pg_byteamagic.
Version
| OS / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 0.2.4 el8.x86_64.pg18 : pg_byteamagic_18 pg_byteamagic_18-0.2.4-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.2.4 el8.x86_64.pg17 : pg_byteamagic_17 pg_byteamagic_17-0.2.4-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.2.4 el8.x86_64.pg16 : pg_byteamagic_16 pg_byteamagic_16-0.2.4-1PGSTY.el8.x86_64.rpm
| PIGSTY 0.2.4 el8.x86_64.pg15 : pg_byteamagic_15 pg_byteamagic_15-0.2.4-1PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | N/A | PIGSTY 0.2.4 el8.aarch64.pg18 : pg_byteamagic_18 pg_byteamagic_18-0.2.4-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.2.4 el8.aarch64.pg17 : pg_byteamagic_17 pg_byteamagic_17-0.2.4-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.2.4 el8.aarch64.pg16 : pg_byteamagic_16 pg_byteamagic_16-0.2.4-1PGSTY.el8.aarch64.rpm
| PIGSTY 0.2.4 el8.aarch64.pg15 : pg_byteamagic_15 pg_byteamagic_15-0.2.4-1PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 0.2.4 el9.x86_64.pg19 : pg_byteamagic_19 pg_byteamagic_19-0.2.4-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.2.4 el9.x86_64.pg18 : pg_byteamagic_18 pg_byteamagic_18-0.2.4-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.2.4 el9.x86_64.pg17 : pg_byteamagic_17 pg_byteamagic_17-0.2.4-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.2.4 el9.x86_64.pg16 : pg_byteamagic_16 pg_byteamagic_16-0.2.4-1PGSTY.el9.x86_64.rpm
| PIGSTY 0.2.4 el9.x86_64.pg15 : pg_byteamagic_15 pg_byteamagic_15-0.2.4-1PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 0.2.4 el9.aarch64.pg19 : pg_byteamagic_19 pg_byteamagic_19-0.2.4-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.2.4 el9.aarch64.pg18 : pg_byteamagic_18 pg_byteamagic_18-0.2.4-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.2.4 el9.aarch64.pg17 : pg_byteamagic_17 pg_byteamagic_17-0.2.4-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.2.4 el9.aarch64.pg16 : pg_byteamagic_16 pg_byteamagic_16-0.2.4-1PGSTY.el9.aarch64.rpm
| PIGSTY 0.2.4 el9.aarch64.pg15 : pg_byteamagic_15 pg_byteamagic_15-0.2.4-1PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 0.2.4 el10.x86_64.pg19 : pg_byteamagic_19 pg_byteamagic_19-0.2.4-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.2.4 el10.x86_64.pg18 : pg_byteamagic_18 pg_byteamagic_18-0.2.4-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.2.4 el10.x86_64.pg17 : pg_byteamagic_17 pg_byteamagic_17-0.2.4-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.2.4 el10.x86_64.pg16 : pg_byteamagic_16 pg_byteamagic_16-0.2.4-1PGSTY.el10.x86_64.rpm
| PIGSTY 0.2.4 el10.x86_64.pg15 : pg_byteamagic_15 pg_byteamagic_15-0.2.4-1PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 0.2.4 el10.aarch64.pg19 : pg_byteamagic_19 pg_byteamagic_19-0.2.4-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.2.4 el10.aarch64.pg18 : pg_byteamagic_18 pg_byteamagic_18-0.2.4-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.2.4 el10.aarch64.pg17 : pg_byteamagic_17 pg_byteamagic_17-0.2.4-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.2.4 el10.aarch64.pg16 : pg_byteamagic_16 pg_byteamagic_16-0.2.4-1PGSTY.el10.aarch64.rpm
| PIGSTY 0.2.4 el10.aarch64.pg15 : pg_byteamagic_15 pg_byteamagic_15-0.2.4-1PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 0.2.4 d12.x86_64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.2.4 d12.x86_64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.2.4 d12.x86_64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.2.4 d12.x86_64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~bookworm_amd64.deb
| PIGSTY 0.2.4 d12.x86_64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 0.2.4 d12.aarch64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.2.4 d12.aarch64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.2.4 d12.aarch64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.2.4 d12.aarch64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~bookworm_arm64.deb
| PIGSTY 0.2.4 d12.aarch64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 0.2.4 d13.x86_64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~trixie_amd64.deb
| PIGSTY 0.2.4 d13.x86_64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~trixie_amd64.deb
| PIGSTY 0.2.4 d13.x86_64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~trixie_amd64.deb
| PIGSTY 0.2.4 d13.x86_64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~trixie_amd64.deb
| PIGSTY 0.2.4 d13.x86_64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 0.2.4 d13.aarch64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~trixie_arm64.deb
| PIGSTY 0.2.4 d13.aarch64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~trixie_arm64.deb
| PIGSTY 0.2.4 d13.aarch64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~trixie_arm64.deb
| PIGSTY 0.2.4 d13.aarch64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~trixie_arm64.deb
| PIGSTY 0.2.4 d13.aarch64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 0.2.4 u22.x86_64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~jammy_amd64.deb
| PIGSTY 0.2.4 u22.x86_64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~jammy_amd64.deb
| PIGSTY 0.2.4 u22.x86_64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~jammy_amd64.deb
| PIGSTY 0.2.4 u22.x86_64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~jammy_amd64.deb
| PIGSTY 0.2.4 u22.x86_64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 0.2.4 u22.aarch64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~jammy_arm64.deb
| PIGSTY 0.2.4 u22.aarch64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~jammy_arm64.deb
| PIGSTY 0.2.4 u22.aarch64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~jammy_arm64.deb
| PIGSTY 0.2.4 u22.aarch64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~jammy_arm64.deb
| PIGSTY 0.2.4 u22.aarch64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 0.2.4 u24.x86_64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~noble_amd64.deb
| PIGSTY 0.2.4 u24.x86_64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~noble_amd64.deb
| PIGSTY 0.2.4 u24.x86_64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~noble_amd64.deb
| PIGSTY 0.2.4 u24.x86_64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~noble_amd64.deb
| PIGSTY 0.2.4 u24.x86_64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 0.2.4 u24.aarch64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~noble_arm64.deb
| PIGSTY 0.2.4 u24.aarch64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~noble_arm64.deb
| PIGSTY 0.2.4 u24.aarch64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~noble_arm64.deb
| PIGSTY 0.2.4 u24.aarch64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~noble_arm64.deb
| PIGSTY 0.2.4 u24.aarch64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 0.2.4 u26.x86_64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~resolute_amd64.deb
| PIGSTY 0.2.4 u26.x86_64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~resolute_amd64.deb
| PIGSTY 0.2.4 u26.x86_64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~resolute_amd64.deb
| PIGSTY 0.2.4 u26.x86_64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~resolute_amd64.deb
| PIGSTY 0.2.4 u26.x86_64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 0.2.4 u26.aarch64.pg19 : postgresql-19-pg-byteamagic postgresql-19-pg-byteamagic_0.2.4-1PGSTY~resolute_arm64.deb
| PIGSTY 0.2.4 u26.aarch64.pg18 : postgresql-18-pg-byteamagic postgresql-18-pg-byteamagic_0.2.4-1PGSTY~resolute_arm64.deb
| PIGSTY 0.2.4 u26.aarch64.pg17 : postgresql-17-pg-byteamagic postgresql-17-pg-byteamagic_0.2.4-1PGSTY~resolute_arm64.deb
| PIGSTY 0.2.4 u26.aarch64.pg16 : postgresql-16-pg-byteamagic postgresql-16-pg-byteamagic_0.2.4-1PGSTY~resolute_arm64.deb
| PIGSTY 0.2.4 u26.aarch64.pg15 : postgresql-15-pg-byteamagic postgresql-15-pg-byteamagic_0.2.4-1PGSTY~resolute_arm64.deb
|
Build
You can build the RPM / DEB packages for pg_byteamagic using pig build:
Install
You can install pg_byteamagic directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
Sources: official repo, official doc
byteamagic runs libmagic on bytea values, so PostgreSQL can identify the MIME type or human-readable file type of blobs stored in the database. The package name is pg_byteamagic, but the extension name is byteamagic.
Functions
byteamagic_mime(bytea) returns text: MIME type, equivalent tofile --mime-type.byteamagic_text(bytea) returns text: descriptive file type text, equivalent tofile.
Common Use
Caveats
- It only inspects
byteacontent; there are no operators, custom types, or extra SQL management objects. - Build/install requires PostgreSQL development headers plus the system
libmagicdevelopment package. - The upstream documentation is minimal; current user-facing behavior is unchanged from the long-standing doc page.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)