SHOW SESSION POLICIES¶

Lists session policy information, including the creation date, database and schema names, owner, and any available comments.

See also:

Session Policy DDL Reference

Syntax¶

SHOW SESSION POLICIES
Copy

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

APPLY SESSION POLICY

Account

OWNERSHIP

Session 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).

Note that operating on any object in a schema also requires the USAGE privilege on the parent database and 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.

For additional details on session policy DDL and privileges, see Managing Session Policies.

Usage notes¶

  • The command does not require a running warehouse to execute.

  • The value for LIMIT rows cannot exceed 10000. If LIMIT rows is omitted, the command results in an error if the result set is larger than 10K rows.

    To view results for which more than 10K records exist, either include LIMIT rows or query the corresponding view in the Snowflake Information Schema.

  • To post-process the output of this command, you can use the RESULT_SCAN function, which treats the output as a table that can be queried.

Example¶

SHOW SESSION POLICIES;
Copy
----------------------------------+-----------------------+---------------+-------------+----------------+--------------+--------------------------------------------------+---------+
         created_on               | name                  | database_name | schema_name |      kind      |  owner       |   comment                                        | options |
----------------------------------+-----------------------+---------------+-------------+----------------+--------------+--------------------------------------------------+---------+
  Mon, 11 Jan 2021 00:00:00 -0700 | session_policy_prod_1 | MY_DB         | MY_SCHEMA   | SESSION_POLICY | POLICY_ADMIN | session policy for use in the prod_1 environment | ""      |
----------------------------------+-----------------------+---------------+-------------+----------------+--------------+--------------------------------------------------+---------+