SHOW PACKAGES POLICIES

列出软件包策略信息。

语法

SHOW PACKAGES POLICIES [ IN
                            {
                              SCHEMA                   |
                              SCHEMA <schema_name>     |
                              <schema_name>
                            }
                       ]
Copy

参数

[ IN ... ]

(可选)指定命令的作用域。指定以下任一项:

SCHEMA. SCHEMA schema_name. schema_name

返回当前正在使用的架构或指定架构 (schema_name) 的记录。

如果数据库正在使用中,或者指定了完全限定 schema_name (例如 db.schema),则 SCHEMA 是可选选项。

如果未使用任何数据库,则指定 SCHEMA 对输出没有影响。

输出

命令输出在以下列中提供策略属性和元数据:

描述

created_on

创建策略的日期和时间。

name

策略的名称。

database_name

存储策略的数据库。

schema_name

存储策略的架构。

kind

策略种类。

owner

拥有策略的角色(即具有对策略的 OWNERSHIP 权限)

comment

策略的注释。

owner_role_type

拥有对象的角色类型,例如 ROLE. 如果 Snowflake Native App 拥有该对象,则该值为 APPLICATION. 如果您删除该对象,则 Snowflake 会返回 NULL,原因是删除的对象不具有所有者角色。

访问控制要求

用于执行此 SQL 命令的 角色 必须至少具有以下 一项 权限

权限

对象

备注

OWNERSHIP

包策略

OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege).

USAGE

包策略

还授予对包策略执行 SHOW 或 DESCRIBE 命令的能力。可以使用 GRANT <privileges> ... TO ROLE 命令授予角色。

The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema. Note that a role granted any privilege on a schema allows that role to resolve the schema. For example, a role granted CREATE privilege on a schema can create objects on that schema without also having USAGE granted on that schema.

有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色

有关对 安全对象 执行 SQL 操作的相应角色和权限授予的一般信息,请参阅 访问控制概述

使用说明

  • 该命令不需要正在运行的仓库即可执行。

  • 该命令仅返回当前用户的当前角色已获授至少一项访问权限的对象。

  • MANAGE GRANTS 访问权限隐式允许其持有者查看账户中的每个对象。默认情况下,只有账户管理员(具有 ACCOUNTADMIN 角色的用户)和安全管理员(具有 SECURITYADMIN 角色的用户)才具有 MANAGE GRANTS 权限。

  • To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.

    The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is type, then specify "type" for the identifier.

  • LIMIT rows 的值不能超过 10000。如果省略 LIMIT rows,若结果集大于 1 万行,则该命令将导致错误。

    要查看存在超过 1 万条记录的结果,请在 Snowflake Information Schema 中包含 LIMIT rows 或查询相应的视图。

示例

SHOW PACKAGES POLICIES;
Copy
语言: 中文