Before writing a CREATE JOIN POLICY statement:
- Read
references/parameters.mdto review all available parameters and their defaults. - For each parameter, decide whether the user's request implies a non-default value.
- Include only the parameters that differ from the default or that the user explicitly requested.
- Never use
CREATE OR REPLACE— always useCREATE JOIN POLICY IF NOT EXISTS. - The policy body must call
JOIN_CONSTRAINT(JOIN_REQUIRED => <boolean_expression>). UseTRUEto enforce that queries must join to another table; useFALSEto allow unrestricted queries (equivalent to no policy). - The allowed join columns are configured when the policy is assigned to a table or view (
ALTER TABLE ... SET JOIN POLICY), not in the CREATE statement itself. - The policy body cannot reference user-defined functions, tables, or views.