Files
buzz/schema/functions/channel_policy_lock_key.sql
jm 525945d63d Implement relay IFC policy fencing
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: jm <jm@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
2026-10-14 18:15:18 +00:00

12 lines
492 B
PL/PgSQL

-- Same advisory coordinate historically named buzz_channel_membership. Policy
-- generation subsumes that serialization boundary so old and new writers
-- contend on one key during rolling migration.
CREATE FUNCTION channel_policy_lock_key(target_community UUID, target_channel UUID)
RETURNS BIGINT
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE AS $$
SELECT hashtextextended(
'buzz_channel_membership:' || target_community::text || ':' || target_channel::text,
0
)
$$;