mirror of
https://github.com/block/buzz.git
synced 2026-11-12 12:22:06 +00:00
The discriminator was `LIKE '%45001%'` — keying on an incidental member of the allowlist kind set. A future negative blocklist containing 45001 would misclassify as allowlist and leave 31234 indexed. Switch to detecting the allowlist's structural shape: the positive allowlist (0008) falls through to `ELSE NULL::tsvector` for unlisted kinds, while the legacy blocklist uses `THEN NULL::tsvector` for excluded kinds. Checking for `ELSE NULL` in the `pg_get_expr` output is robust against future kind list changes in either form. Also fixes the no-op path comment: `LOCK TABLE ... IN SHARE ROW EXCLUSIVE MODE` runs before the branch on every path, so the no-op path does not "acquire no exclusive lock" — it does not escalate to ACCESS EXCLUSIVE.