mirror of
https://github.com/block/buzz.git
synced 2026-10-29 13:31:44 +00:00
Keep Start off by default. Admit owner-private encrypted command and receipt transport, fence immutable retries, and expose provisioned destination selection. Exercise two isolated native executors through spawn, signed receipt, live run label, and source restart; no physical-host or real-model certification. Signed-off-by: Logan Johnson <loganj@squareup.com>
27 lines
949 B
SQL
27 lines
949 B
SQL
-- Private execution commands and receipts must not be indexed. Same heap-rewrite operational
|
|
-- cost as 0033: schedule a maintenance window for large databases.
|
|
DO $$
|
|
DECLARE
|
|
existing_expression TEXT;
|
|
BEGIN
|
|
SELECT pg_get_expr(d.adbin, d.adrelid)
|
|
INTO existing_expression
|
|
FROM pg_attrdef d
|
|
JOIN pg_attribute a
|
|
ON a.attrelid = d.adrelid
|
|
AND a.attnum = d.adnum
|
|
WHERE d.adrelid = 'events'::regclass
|
|
AND a.attname = 'search_tsv';
|
|
|
|
IF existing_expression IS NULL THEN
|
|
RAISE EXCEPTION 'events.search_tsv generated expression not found';
|
|
END IF;
|
|
|
|
ALTER TABLE events DROP COLUMN search_tsv;
|
|
EXECUTE format(
|
|
'ALTER TABLE events ADD COLUMN search_tsv TSVECTOR GENERATED ALWAYS AS (CASE WHEN kind IN (50001, 50002) THEN NULL::tsvector ELSE (%s) END) STORED',
|
|
existing_expression
|
|
);
|
|
CREATE INDEX idx_events_search_tsv ON events USING GIN (search_tsv);
|
|
END $$;
|