> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> 包含系统中所有脱敏策略信息的系统表。

# system.masking_policies

<div id="description">
  ## 说明
</div>

包含系统中定义的所有脱敏策略相关信息。

脱敏策略只能在 ClickHouse Cloud 中创建和应用。在开源构建中，`system.masking_policies` 表始终为空，但该表仍然存在，以便 `SHOW MASKING POLICIES` 这类内部信息查询能够正常工作，并返回空结果而不是抛出异常。

<div id="columns">
  ## 列
</div>

* `name` ([String](/docs/zh/reference/data-types/string)) — 数据脱敏策略的名称。完整名称格式为 `short_name ON database.table`。
* `short_name` ([String](/docs/zh/reference/data-types/string)) — 数据脱敏策略的短名称。例如，如果完整名称为 `mask_email ON mydb.mytable`，则短名称为 `mask_email`。
* `database` ([String](/docs/zh/reference/data-types/string)) — 数据库名称。
* `table` ([String](/docs/zh/reference/data-types/string)) — 表名称。
* `id` ([UUID](/docs/zh/reference/data-types/uuid)) — 数据脱敏策略 ID。
* `storage` ([String](/docs/zh/reference/data-types/string)) — 存储该数据脱敏策略的目录名称。
* `update_assignments` ([Nullable(String)](/docs/zh/reference/data-types/nullable)) — 定义数据应如何脱敏的 UPDATE 赋值。例如：`email = '***masked***', phone = '***-***-****'`。
* `where_condition` ([Nullable(String)](/docs/zh/reference/data-types/nullable)) — 可选的 WHERE 条件，用于指定在何种情况下应用脱敏。
* `priority` ([Int64](/docs/zh/reference/data-types/int-uint)) — 应用多个脱敏策略时的优先级。优先级更高的策略会先应用。默认值为 0。
* `apply_to_all` ([UInt8](/docs/zh/reference/data-types/int-uint)) — 表示该数据脱敏策略是否适用于所有角色和/或用户。为 true 时值为 1，否则为 0。
* `apply_to_list` ([Array(String)](/docs/zh/reference/data-types/array)) — 应用该数据脱敏策略的角色和/或用户列表。
* `apply_to_except` ([Array(String)](/docs/zh/reference/data-types/array)) — 该数据脱敏策略适用于除所列角色和/或用户外的所有角色和/或用户。仅当 `apply_to_all` 为 1 时填充。
