

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

# HAS\$1SCHEMA\$1PRIVILEGE
<a name="r_HAS_SCHEMA_PRIVILEGE"></a>

Returns `true` if the user has the specified privilege for the specified schema. For more information about privileges, see [GRANT](r_GRANT.md).

## Syntax
<a name="r_HAS_SCHEMA_PRIVILEGE-synopsis"></a>

**Note**  
This is a leader-node function. This function returns an error if it references a user-created table, an STL or STV system table, or an SVV or SVL system view.

```
has_schema_privilege( [ user, ] schema, privilege)
```

## Arguments
<a name="r_HAS_SCHEMA_PRIVILEGE-arguments"></a>

 *user*   
The name of the user to check for schema privileges. The default is to check the current user. 

 *schema*   
The schema associated with the privilege. 

 *privilege*   
The privilege to check. Valid values are the following:   
+ CREATE
+ USAGE
+ ALTER
+ DROP

## Return type
<a name="r_HAS_SCHEMA_PRIVILEGE-return-type"></a>

Returns a CHAR or VARCHAR string. 

## Example
<a name="r_HAS_SCHEMA_PRIVILEGE-example"></a>

The following query confirms that the GUEST user has the CREATE privilege on the PUBLIC schema: 

```
select has_schema_privilege('guest', 'public', 'create');

has_schema_privilege
----------------------
true
(1 row)
```