acdat
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
acdat | 0.1.0 | FTS | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2250 | acdat | No | Yes | No | Yes | No | No | acdat |
Indexes the compiled pattern dictionary, not the document table; exact case-sensitive matching in the fixed acdat schema.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.0 | 1817161514 | acdat | - |
| RPM | PIGSTY | 0.1.0 | 1817161514 | acdat_$v | - |
| DEB | PIGSTY | 0.1.0 | 1817161514 | postgresql-$v-acdat | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | MISS | MISS | MISS | MISS | MISS |
| el8.aarch64 | MISS | MISS | MISS | MISS | MISS |
| el9.x86_64 | MISS | MISS | MISS | MISS | MISS |
| el9.aarch64 | MISS | MISS | MISS | MISS | MISS |
| el10.x86_64 | MISS | MISS | MISS | MISS | MISS |
| el10.aarch64 | MISS | MISS | MISS | MISS | MISS |
| d12.x86_64 | MISS | MISS | MISS | MISS | MISS |
| d12.aarch64 | MISS | MISS | MISS | MISS | MISS |
| d13.x86_64 | MISS | MISS | MISS | MISS | MISS |
| d13.aarch64 | MISS | MISS | MISS | MISS | MISS |
| u22.x86_64 | MISS | MISS | MISS | MISS | MISS |
| u22.aarch64 | MISS | MISS | MISS | MISS | MISS |
| u24.x86_64 | MISS | MISS | MISS | MISS | MISS |
| u24.aarch64 | MISS | MISS | MISS | MISS | MISS |
| u26.x86_64 | MISS | MISS | MISS | MISS | MISS |
| u26.aarch64 | MISS | MISS | MISS | MISS | MISS |
Build
You can build the RPM / DEB packages for acdat using pig build:
Install
You can install acdat directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
- Official README v0.1.0
- Extension control file
- Versioned installation SQL
- Official usage guide
- Runnable SQL demonstration
acdat 0.1.0 compiles a large dictionary of exact literal patterns into an immutable Aho-Corasick Double-Array machine, then scans each text or bytea value once for matching or replacement. It is designed for stable, repeatedly used dictionaries such as policy rules, indicators of compromise, entity names, and redaction aliases.
Core Workflow
Create the extension, compile a dictionary, and reuse the resulting acdat.machine value across many inputs:
For production dictionaries, the source rules should stay in an application-owned table. The aggregate overload of acdat.compile() can build one deterministic machine directly from pattern, ID, replacement, and priority rows; compile once and scan many values.
Matching and Replacement
acdat.contains() stops after the first hit. acdat.matches() returns acdat.hit rows with the pattern ID, byte and character coordinates, and priority. acdat.replace() applies literal, non-recursive replacements:
The match policies are all_overlapping, leftmost_longest, and leftmost_priority. Replacement accepts only a non-overlapping policy. Use acdat.info() to inspect a compiled machine and the export, validation, import, and fingerprint functions when moving or checking artifacts.
acdat.matches() defaults max_matches to 10000, and acdat.replace() defaults max_output_bytes to 268435456. Set tighter limits for untrusted or high-hit inputs so match enumeration and replacement output stay bounded.
Managed Dictionaries
The optional catalog layer publishes immutable, content-addressed builds and atomically selects one active build. Its control functions use SECURITY INVOKER and are not executable by PUBLIC:
Application tables remain the source of truth. Logical dumps include catalog metadata and active machine payloads, but not every historical artifact, so retain the source patterns required to rebuild retired or inactive versions.
Compatibility and Safety
Version 0.1.0 is tested on PostgreSQL 14 through 18. It needs no preload or server restart, has no external extension dependency, and defines no GUC. The control file fixes the schema to acdat, sets relocatable = false and trusted = false, so CREATE EXTENSION requires a superuser.
ACDAT indexes the pattern dictionary, not the document table: scanning a large existing table still reads its candidate rows. Matching is exact and case-sensitive; the extension does not provide regular expressions, fuzzy matching, tokenization, automatic case folding, Unicode normalization, or a document-side index. The text engine supports UTF-8 and single-byte server encodings, while binary data should use the bytea interface. Materialize (document_id, pattern_id) hits into an application table when repeated reverse lookup is required.
The compiled format is self-describing and checksummed, and imported artifacts are validated before use. Inventory dependencies before uninstalling: DROP EXTENSION acdat removes managed dictionary state, while adding CASCADE can also remove user columns or other objects that depend on acdat.machine.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)