SHOW PACKAGES POLICIES
statementsupportedGovernance (policies, tags, data quality)Lists packages policy information.
Syntax
supportedpartialnot supportednot scored
SHOW PACKAGES POLICIES [ IN
{
SCHEMA |
SCHEMA <schema_name> |
<schema_name>
}
]
Parameters
| Name | Required | Description |
|---|---|---|
[ IN ... ] | Optionally specifies the scope of the command. Specify one of the following: | |
SCHEMA, SCHEMA schema_name, schema_name | Returns records for the current schema in use or a specified schema (schema_name). SCHEMA is optional if a database is in use or if you specify the fully qualified schema_name (for example, db.schema). If no database is in use, specifying SCHEMA has no effect on the output. |
Usage notes
- The command doesn’t require a running warehouse to execute.
- The command only returns objects for which the current user’s current role has been granted at least one access privilege.
- The MANAGE GRANTS access privilege implicitly allows its holder to see every object in the account. By default, only the account administrator (users with the ACCOUNTADMIN role) and security administrator (users with the SECURITYADMIN role) have the MANAGE GRANTS privilege.
- 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. For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows. When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column type, specify SELECT "type". You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.
- The value for LIMIT rows can’t exceed 10000. If LIMIT rows is omitted, the command results in an error if the result set is larger than ten thousand rows. To view results for which more than ten thousand records exist, either include LIMIT rows or query the corresponding view in the Snowflake Information Schema.
Output
The command output provides policy properties and metadata in the following columns: Column | Description created_on | Date and time when the policy was created. name | Name of the policy. database_name | Database in which the policy is stored. schema_name | Schema in which the policy is stored. kind | The kind of policy. owner | Role that owns the policy (i.e. has the OWNERSHIP privilege on the policy) comment | Comment for the policy. owner_role_type | The type of role that owns the object, for example ROLE. If a Snowflake Native App owns the object, the value is APPLICATION. Snowflake returns NULL if you delete the object because a deleted object does not have an owner role.
Access control requirements
A role used to execute this SQL command must have at least one of the following privileges at a minimum: Privilege | Object | Notes OWNERSHIP | Packages policy | 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 | Packages policy | Also grants the ability to execute a SHOW or DESCRIBE command on the packages policy. Can be granted to a role using the GRANT <privileges> … TO ROLE command. Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.