Before writing a CREATE PROJECTION 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 — do not bloat the DDL with unnecessary clauses.
- Never use
CREATE OR REPLACE— always useCREATE PROJECTION POLICY IF NOT EXISTS. - The policy body must call
PROJECTION_CONSTRAINT(ALLOW => {TRUE|FALSE} [, ENFORCEMENT => {'FAIL'|'NULLIFY'}]). ALLOW => TRUEpermits column projection (pass-through);ALLOW => FALSErestricts it — use theENFORCEMENTargument to control whether restricted queries fail or return NULLs.- The default
ENFORCEMENTisFAIL; only specifyNULLIFYif the user explicitly wants columns silently nullified rather than causing query failures. - Projection policies only affect columns in the final result set (outermost SELECT); columns used only in WHERE or JOIN clauses are not blocked. Requires Enterprise Edition or higher.