<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>acdat on PGSTY EXT</title><link>https://ext.pgsty.com/docs/acdat/</link><description>Recent content in acdat on PGSTY EXT</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 01 Dec 2026 12:26:58 +0800</lastBuildDate><atom:link href="https://ext.pgsty.com/docs/acdat/index.xml" rel="self" type="application/rss+xml"/><item><title>acdat SQL reference</title><link>https://ext.pgsty.com/docs/acdat/reference/</link><guid>https://ext.pgsty.com/docs/acdat/reference/</guid><description>&lt;h2 id="build"&gt;Compile a dictionary&#10;&lt;/h2&gt;&#10;&lt;div class="td-fields"&gt;&#10;&lt;dl class="td-fields__list"&gt;&#10;&lt;div class="td-field"&gt;&#10;&lt;dt class="td-field__term"&gt;&lt;code class="td-field__name"&gt;acdat.compile(patterns text[], pattern_ids bigint[], replacements text[], priorities integer[], options jsonb)&lt;/code&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__type"&gt;&lt;span class="td-field__meta-value"&gt;&lt;code&gt;acdat.machine&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__default"&gt;&lt;span class="td-field__meta-label"&gt;default&lt;/span&gt;&lt;span class="td-field__meta-value"&gt;&lt;code&gt;NULL, NULL, NULL, '{}'&lt;/code&gt;¹&lt;/span&gt;&lt;/span&gt;&#10;&lt;/dt&gt;&#10;&lt;dd class="td-field__description"&gt;Compile parallel 1D text arrays into a machine. Omitted IDs default to &lt;code&gt;1..N&lt;/code&gt;; &lt;code&gt;NULL&lt;/code&gt; priorities default to &lt;code&gt;0&lt;/code&gt;.&lt;/dd&gt;&#10;&lt;/div&gt;&#10;&lt;div class="td-field"&gt;&#10;&lt;dt class="td-field__term"&gt;&lt;code class="td-field__name"&gt;acdat.compile(patterns bytea[], pattern_ids bigint[], replacements bytea[], priorities integer[], options jsonb)&lt;/code&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__type"&gt;&lt;span class="td-field__meta-value"&gt;&lt;code&gt;acdat.machine&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__default"&gt;&lt;span class="td-field__meta-label"&gt;default&lt;/span&gt;&lt;span class="td-field__meta-value"&gt;&lt;code&gt;NULL, NULL, NULL, '{}'&lt;/code&gt;¹&lt;/span&gt;&lt;/span&gt;&#10;&lt;/dt&gt;&#10;&lt;dd class="td-field__description"&gt;Binary array overload preserving arbitrary bytes (including &lt;code&gt;\x00&lt;/code&gt;).&lt;/dd&gt;&#10;&lt;/div&gt;&#10;&lt;div class="td-field"&gt;&#10;&lt;dt class="td-field__term"&gt;&lt;code class="td-field__name"&gt;acdat.compile(text, bigint)&lt;/code&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__type"&gt;&lt;span class="td-field__meta-value"&gt;aggregate → &lt;code&gt;acdat.machine&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__default"&gt;&lt;span class="td-field__meta-label"&gt;default&lt;/span&gt;&lt;span class="td-field__meta-value"&gt;&lt;code&gt;—&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;/dt&gt;&#10;&lt;dd class="td-field__description"&gt;Compile rows of &lt;code&gt;(pattern, pattern_id)&lt;/code&gt;. Returns &lt;code&gt;NULL&lt;/code&gt; for zero rows.&lt;/dd&gt;&#10;&lt;/div&gt;&#10;&lt;div class="td-field"&gt;&#10;&lt;dt class="td-field__term"&gt;&lt;code class="td-field__name"&gt;acdat.compile(text, bigint, text, integer)&lt;/code&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__type"&gt;&lt;span class="td-field__meta-value"&gt;aggregate → &lt;code&gt;acdat.machine&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__default"&gt;&lt;span class="td-field__meta-label"&gt;default&lt;/span&gt;&lt;span class="td-field__meta-value"&gt;&lt;code&gt;—&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;/dt&gt;&#10;&lt;dd class="td-field__description"&gt;Compile rows of &lt;code&gt;(pattern, pattern_id, replacement, priority)&lt;/code&gt;. Returns &lt;code&gt;NULL&lt;/code&gt; for zero rows.&lt;/dd&gt;&#10;&lt;/div&gt;&#10;&lt;div class="td-field"&gt;&#10;&lt;dt class="td-field__term"&gt;&lt;code class="td-field__name"&gt;acdat.compile(bytea, bigint)&lt;/code&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__type"&gt;&lt;span class="td-field__meta-value"&gt;aggregate → &lt;code&gt;acdat.machine&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__default"&gt;&lt;span class="td-field__meta-label"&gt;default&lt;/span&gt;&lt;span class="td-field__meta-value"&gt;&lt;code&gt;—&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;/dt&gt;&#10;&lt;dd class="td-field__description"&gt;Binary aggregate over &lt;code&gt;(pattern, pattern_id)&lt;/code&gt;. Returns &lt;code&gt;NULL&lt;/code&gt; for zero rows.&lt;/dd&gt;&#10;&lt;/div&gt;&#10;&lt;div class="td-field"&gt;&#10;&lt;dt class="td-field__term"&gt;&lt;code class="td-field__name"&gt;acdat.compile(bytea, bigint, bytea, integer)&lt;/code&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__type"&gt;&lt;span class="td-field__meta-value"&gt;aggregate → &lt;code&gt;acdat.machine&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;span class="visually-hidden"&gt;, &lt;/span&gt;&lt;span class="td-field__default"&gt;&lt;span class="td-field__meta-label"&gt;default&lt;/span&gt;&lt;span class="td-field__meta-value"&gt;&lt;code&gt;—&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&#10;&lt;/dt&gt;&#10;&lt;dd class="td-field__description"&gt;Binary aggregate over &lt;code&gt;(pattern, pattern_id, replacement, priority)&lt;/code&gt;. Returns &lt;code&gt;NULL&lt;/code&gt; for zero rows.&lt;/dd&gt;&#10;&lt;/div&gt;&#10;&lt;/dl&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;¹ Defaults apply starting at &lt;code&gt;pattern_ids&lt;/code&gt;; &lt;code&gt;patterns&lt;/code&gt; is required. &lt;code&gt;options&lt;/code&gt; accepts &lt;code&gt;NULL&lt;/code&gt; or &lt;code&gt;{}&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Operations</title><link>https://ext.pgsty.com/docs/acdat/operations/</link><guid>https://ext.pgsty.com/docs/acdat/operations/</guid><description>&lt;p&gt;For throughput measurements, parallel execution plans, and per-worker cache sizing, see &lt;a href="https://ext.pgsty.com/docs/acdat/performance/"&gt;Performance and tuning&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="privileges"&gt;1. Least-privilege permissions&#10;&lt;/h2&gt;&#10;&lt;p&gt;A superuser installs &lt;code&gt;acdat&lt;/code&gt;. By default, &lt;code&gt;PUBLIC&lt;/code&gt; receives &lt;code&gt;USAGE&lt;/code&gt; on the &lt;code&gt;acdat&lt;/code&gt; schema and &lt;code&gt;EXECUTE&lt;/code&gt; on scanning/compilation functions, while managed catalog tables and &lt;code&gt;publish&lt;/code&gt; / &lt;code&gt;activate&lt;/code&gt; / &lt;code&gt;retire_build&lt;/code&gt; are revoked from &lt;code&gt;PUBLIC&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;Separate read-only scanning roles from dictionary administrators:&lt;/p&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-395911c7-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="sql" data-td-line-count="20"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-395911c7-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- Scan-only role: reads currently active published machines&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ROLE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;app_scanner&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;GRANT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;active_machine&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;TO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;app_scanner&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- Dictionary admin role: publishes, activates, and retires managed builds&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;-- (management functions run SECURITY INVOKER, so both table and function grants are required)&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ROLE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dict_admin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;GRANT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;DELETE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;dictionary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dictionary_version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dictionary_build&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dictionary_build_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;active_dictionary&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;TO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dict_admin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;GRANT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;EXECUTE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FUNCTION&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;bigint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;machine&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;jsonb&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;activate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;bytea&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;retire_build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;bytea&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;TO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dict_admin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;h2 id="recovery"&gt;2. Backup, restore, and replication&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Logical dumps (&lt;code&gt;pg_dump&lt;/code&gt;)&lt;/strong&gt;: &lt;code&gt;acdat&lt;/code&gt; registers its catalog tables via &lt;code&gt;pg_extension_config_dump()&lt;/code&gt;, dumping all dictionary, version, and build metadata, active pointers, and &lt;strong&gt;active&lt;/strong&gt; machine payloads. Inactive historical payloads are excluded to keep dumps compact—back up your application rule tables so inactive versions can be recompiled on demand.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Physical backups and PITR&lt;/strong&gt;: Include all logged active and inactive payloads automatically. Install a compatible &lt;code&gt;acdat&lt;/code&gt; shared library on the recovery host before starting PostgreSQL.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Logical replication&lt;/strong&gt;: Install &lt;code&gt;acdat&lt;/code&gt; on subscribers beforehand, then either replicate metadata, payload, and activation atomically in one transaction or recompile dictionaries independently on subscribers from replicated source rules.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="errors"&gt;3. Common errors&#10;&lt;/h2&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;Error message&lt;/th&gt;&#10; &lt;th scope="col"&gt;Cause and fix&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;acdat compile failed: pattern ID 1 is duplicated&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Every rule in one dictionary must have a unique &lt;code&gt;pattern_id&lt;/code&gt;. Deduplicate or assign distinct IDs.&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;acdat scan failed: match count exceeds limit 2&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Raw overlapping hits exceeded &lt;code&gt;max_matches&lt;/code&gt; (or &lt;code&gt;max_replacements&lt;/code&gt;) &lt;em&gt;before&lt;/em&gt; overlap resolution. Prune overlapping rules or raise the measured cap.&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;acdat pattern ID 1 has no replacement&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;acdat.replace()&lt;/code&gt; selected a rule whose replacement was &lt;code&gt;NULL&lt;/code&gt;. Supply a literal replacement (or &lt;code&gt;''&lt;/code&gt; to delete).&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;cannot retire the active acdat build&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Activate another &lt;code&gt;ready&lt;/code&gt; build first, then retire the previous build.&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;acdat machine input kind does not match function input&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;A &lt;code&gt;text&lt;/code&gt; machine was passed to a &lt;code&gt;bytea&lt;/code&gt; function (or vice versa). Keep machine and input types paired.&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;acdat build is absent, retired, or has no artifact payload&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;Publish or recompile the target build before calling &lt;code&gt;acdat.activate()&lt;/code&gt;.&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;Other quick checks: cast empty arrays explicitly (&lt;code&gt;ARRAY[]::text[]&lt;/code&gt;), note that an aggregate over zero rows returns &lt;code&gt;NULL&lt;/code&gt;, and on permission errors verify both table and function grants for &lt;code&gt;SECURITY INVOKER&lt;/code&gt; management functions.&lt;/p&gt;</description></item><item><title>Performance and tuning</title><link>https://ext.pgsty.com/docs/acdat/performance/</link><guid>https://ext.pgsty.com/docs/acdat/performance/</guid><description>&lt;p&gt;&lt;code&gt;acdat&lt;/code&gt; compiles fast and scans near memory bandwidth. In production, query latency is usually governed by PostgreSQL&amp;rsquo;s execution plan, row width, and parallel worker count rather than the automaton itself.&lt;/p&gt;&#10;&lt;p&gt;All benchmark figures below were measured on &lt;code&gt;acdat&lt;/code&gt; v0.1.1 (Apple M5 Max, PostgreSQL 18.6, hot buffers, in-database aggregation without client transfer). Full methodology and raw logs: &lt;a href="https://github.com/pgsty/acdat/blob/v0.1.1/docs/PERFORMANCE.md"&gt;PERFORMANCE.md&lt;/a&gt; · &lt;a href="https://github.com/pgsty/acdat/blob/v0.1.1/docs/BENCHMARK.md"&gt;BENCHMARK.md&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="real-corpus"&gt;1. Real corpus throughput (10.3M rows, 1,114 rules)&#10;&lt;/h2&gt;&#10;&lt;p&gt;Dataset: 10,318,163 short video titles (306.9 MiB total, ~31 bytes/row) scanned against a 1,114-rule real dictionary (compiled in 1.16 ms, 227 KiB runtime cache per process).&lt;/p&gt;</description></item><item><title>Examples and workflows</title><link>https://ext.pgsty.com/docs/acdat/examples/</link><guid>https://ext.pgsty.com/docs/acdat/examples/</guid><description>&lt;p&gt;Every example below is self-contained and runs inside PostgreSQL using &lt;code&gt;acdat&lt;/code&gt; v0.1.1.&lt;/p&gt;&#10;&lt;h2 id="policy"&gt;1. Overlapping rules and redaction policies&#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;a id="example"&gt;&lt;/a&gt;&#10;&lt;a id="limits"&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Real dictionaries almost always contain overlapping phrases—for instance, &lt;code&gt;&amp;quot;credit card&amp;quot;&lt;/code&gt;, &lt;code&gt;&amp;quot;credit card fraud&amp;quot;&lt;/code&gt;, and &lt;code&gt;&amp;quot;fraud&amp;quot;&lt;/code&gt;. &lt;code&gt;acdat&lt;/code&gt; resolves overlaps deterministically using three policies:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;all_overlapping&lt;/code&gt; (default for &lt;code&gt;matches&lt;/code&gt;): reports every candidate hit, including prefixes, suffixes, and duplicate text with distinct IDs.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;leftmost_longest&lt;/code&gt; (default for &lt;code&gt;replace&lt;/code&gt;): consumes the leftmost match; at the same start offset, prefers the &lt;strong&gt;longer&lt;/strong&gt; pattern, then &lt;strong&gt;lower&lt;/strong&gt; priority number, then lower ID.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;leftmost_priority&lt;/code&gt;: consumes the leftmost match; at the same start offset, prefers the &lt;strong&gt;lower priority number&lt;/strong&gt; first (e.g., priority &lt;code&gt;10&lt;/code&gt; beats priority &lt;code&gt;20&lt;/code&gt;), then longer pattern, then lower ID.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-1af05217-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="sql" data-td-line-count="13"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-1af05217-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;WITH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dict&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;ARRAY&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;credit card&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;credit card fraud&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;fraud&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;ARRAY&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="nb"&gt;bigint&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;ARRAY&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;[PAYMENT]&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;[HIGH-RISK]&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;[RISK]&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;ARRAY&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="nb"&gt;integer&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;report credit card fraud now&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;leftmost_longest&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;longest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;report credit card fraud now&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;leftmost_priority&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;by_priority&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;acdat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;report credit card fraud now&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;all_overlapping&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;total_hits&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-1af05217-fence-1" data-td-code data-td-code-auto-id&#10; data-td-language="text" data-td-line-count="3"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-1af05217-fence-1-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; longest | by_priority | total_hits&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-------------------------+-----------------------------+------------&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; report [HIGH-RISK] now | report [PAYMENT] [RISK] now | 3&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;Why the two results differ:&lt;/p&gt;</description></item><item><title>Getting started with acdat</title><link>https://ext.pgsty.com/docs/acdat/getting-started/</link><guid>https://ext.pgsty.com/docs/acdat/getting-started/</guid><description>&lt;h2 id="install"&gt;1. Install acdat&#10;&lt;/h2&gt;&#10;&lt;h3 id="install-from-pigsty-packages"&gt;Install from Pigsty packages&#10;&lt;/h3&gt;&#10;&lt;p&gt;CI covers PostgreSQL 14–18, and Pigsty ships packages for PostgreSQL 15–19 across Linux distributions. Check &lt;a href="https://ext.pgsty.com/download/#acdat"&gt;Downloads&lt;/a&gt; for OS and architecture availability.&lt;/p&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-9498cddd-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="bash" data-td-line-count="2"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-9498cddd-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pig repo add pgsql -u&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pig ext add acdat&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;h3 id="or-build-from-the-release-tag"&gt;Or build from the release tag&#10;&lt;/h3&gt;&#10;&lt;p&gt;Point &lt;code&gt;PG_CONFIG&lt;/code&gt; to your target PostgreSQL installation:&lt;/p&gt;</description></item></channel></rss>