Skip to content
pgstyPublic

About

Aho-Corasick Automaton with Double Array Trie (Multi-pattern substitute in go)

Resources

Stars

663 stars

Watchers

24 watching

Forks

Latest commit

 

History

26 Commits

Folders and files

Repository files navigation

acdat

Release acdat documentation License

acdat finds many literal patterns in PostgreSQL text or bytea in a single scan. Compile a dictionary once, then reuse it to locate matches or replace them.

Quick start

Install the Linux package with PIG. Set -v to your PostgreSQL major (15–19). Get PIG

pig repo add pgsql -u
pig ext add acdat -v 19

In the target database, find both terms and their starting byte positions.

CREATE EXTENSION acdat;

SELECT pattern_id, start_byte
FROM acdat.matches('timeout, then retry', acdat.compile(ARRAY['timeout', 'retry']))
ORDER BY start_byte;
-- pattern_id | start_byte
--          1 |          1
--          2 |         15

SQL reference · 中文文档

About

Aho-Corasick Automaton with Double Array Trie (Multi-pattern substitute in go)

Resources

Stars

663 stars

Watchers

24 watching

Forks

Releases

Packages

Used by

Contributors

Languages