

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# SVV\_DATABASE\_PRIVILEGES
<a name="r_SVV_DATABASE_PRIVILEGES"></a>

Use SVV\_DATABASE\_PRIVILEGES to view the database permissions that are explicitly granted to users, roles, and groups in your Amazon Redshift cluster.

SVV\_DATABASE\_PRIVILEGES is visible to the following users:
+ Superusers
+ Users with the ACCESS SYSTEM TABLE permission

Other users can only see identities they have access to or own.

For more information about best practices when querying system tables and views, see [Querying System Tables](https://docs.aws.amazon.com/redshift/latest/mgmt/discovering-metadata-system-tables.html).

**Note**  
Use the [SHOW GRANTS](r_SHOW_GRANTS.md) command for permission discovery. SHOW GRANTS works consistently across local, datashare, and external catalog contexts and is updated as new features are released. For more information, see [Best practices for discovering metadata](https://docs.aws.amazon.com/redshift/latest/mgmt/best-practices-discovering-metadata.html).

## Table columns
<a name="r_SVV_DATABASE_PRIVILEGES-table-columns"></a>


| Column name  | Data type  | Description | 
| --- | --- | --- | 
| database\_name | text | The name of the database. | 
| privilege\_type | text | The type of the permission. For permissions with a privilege\_scope of database, possible values are USAGE, CREATE, TEMPORARY, TEMP, and ALTER. For privilege\_scope values other than database, possible values include any permission type available on the permission's scope. | 
| identity\_id | integer | The ID of the identity. Possible values are user ID, role ID, or group ID. | 
| identity\_name | text | The name of the identity. | 
| identity\_type | text | The type of the identity. Possible values are user, role, group, or public. | 
| admin\_option | boolean | A value that indicates whether the user can grant the permission to other users and roles. It is always false for the role and group identity type. | 
| privilege\_scope | text | The scope of the permission specified in privilege\_type. Possible values are as follows: [See the AWS documentation website for more details](http://docs.aws.amazon.com/redshift/latest/dg/r_SVV_DATABASE_PRIVILEGES.html) For information on scoped permissions, go to [Scoped permissions](t_scoped-permissions.md).  | 

## Sample query
<a name="r_SVV_DATABASE_PRIVILEGES-sample-query"></a>

The following example displays the result of the SVV\_DATABASE\_PRIVILEGES.

```
SELECT database_name,privilege_type,identity_name,identity_type,admin_option FROM svv_database_privileges
WHERE database_name = 'test_db';

 database_name | privilege_type | identity_name | identity_type | admin_option
---------------+----------------+---------------+---------------+--------------
     test_db   |     CREATE     |     reguser   |      user     |     False
     test_db   |     CREATE     |      role1    |      role     |     False
     test_db   |     TEMP       |      public   |      public   |     False
     test_db   |     TEMP       |      role1    |      role     |     False
```