跳转到主要内容

omni_mimetypes

MIME types

omnigres : MIME types

Overview

ID Extension Package Version Category License Language
2957 omni_mimetypes omnigres 0.1.0 FEAT Apache-2.0 C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
----d-- No No No Yes no no

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 0.1.0 18 17 16 15 14 omnigres -
RPM PIGSTY 20251108 18 17 16 15 14 omnigres_$v -
DEB PIGSTY 20251108 18 17 16 15 14 postgresql-$v-omnigres -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
el8.aarch64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
el9.x86_64 PIGSTY 20251108 PIGSTY 20250507 PIGSTY 20250507 PIGSTY 20250507 PIGSTY 20250507
el9.aarch64 PIGSTY 20251108 PIGSTY 20250507 PIGSTY 20250507 PIGSTY 20250507 PIGSTY 20250507
el10.x86_64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
el10.aarch64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
d12.x86_64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
d12.aarch64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
d13.x86_64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
d13.aarch64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
u22.x86_64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
u22.aarch64 PIGSTY 20251108 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120 PIGSTY 20250120
u24.x86_64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
u24.aarch64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
u26.x86_64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108
u26.aarch64 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108 PIGSTY 20251108

Source

docs.omnigres.org/omni_mimetypes/reference/

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

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

Create this extension with:

CREATE EXTENSION omni_mimetypes;

Usage

omni_mimetypes: MIME types

The omni_mimetypes extension provides MIME type data sourced from IANA, Apache, and Nginx (via mime-db).

Tables

  • omni_mimetypes.mime_typesid, name (unique), source (iana/apache/nginx), compressible, charset
  • omni_mimetypes.file_extensionsid, extension (without dot prefix)
  • omni_mimetypes.mime_types_file_extensions – Junction table linking MIME types to file extensions

Find MIME Type by Extension

SELECT mime_types.name
FROM omni_mimetypes.mime_types
JOIN omni_mimetypes.mime_types_file_extensions mtfe ON mtfe.mime_type_id = mime_types.id
JOIN omni_mimetypes.file_extensions ON mtfe.file_extension_id = file_extensions.id
WHERE file_extensions.extension = 'js';
-- Result: application/javascript

Update MIME Database

CREATE EXTENSION omni_httpc CASCADE;
WITH db AS (
    SELECT * FROM omni_httpc.http_execute(
        omni_httpc.http_request(
            'https://cdn.jsdelivr.net/gh/jshttp/[email protected]/db.json'))
)
SELECT omni_mimetypes.import_mime_db(convert_from(body, 'utf8')::jsonb) FROM db;