# has_schema_privilege

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: has_schema_privilege
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-functions/other-functions/has-schema-privilege
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-functions/other-functions/has-schema-privilege.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/other-functions/has-schema-privilege.adoc
description: The has_schema_privilege() function checks whether the current user has specific privileges on a schema.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/other-functions/has-schema-privilege.md -->

The [`has_schema_privilege()`](https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-INFO-ACCESS) function is an access privilege inquiry function that checks whether the current user has specific privileges on a schema.

## [](#syntax)Syntax

The `has_schema_privilege` function has two available syntax versions:

```sql
SELECT has_schema_privilege('user', 'schema', 'privilege');
```

```sql
SELECT has_schema_privilege('schema', 'privilege');
```

The function returns a boolean value: `TRUE` if the user has the specified privilege, `FALSE` otherwise.

## [](#parameters)Parameters

-   `schema`: Name of the schema to check privileges for (can be any string value or string columns from other tables).

-   `user`: Name of the user who has the privileges (can be any string value).

-   `privilege`: Specifies the specific privilege to check for in the schema. The function currently supports `create` and `usage`.


> 📝 **NOTE**
>
> The comparison for the `privilege` is case-insensitive, so you can use lowercase or uppercase notation for the privilege name.

## [](#examples)Examples

### [](#check-for-create-privilege)Check for CREATE privilege

This example uses the `has_schema_privilege()` function to determine whether the current user has the `create` privilege on a schema named `public`:

```sql
SELECT has_schema_privilege('public', 'create');
```

The query returns `TRUE`, which means that the current user has a `create` privilege on the `public` schema.

```sql
 has_schema_privilege
----------------------
 t
```

### [](#check-for-usage-privilege)Check for USAGE privilege

Use the `has_schema_privilege()` function to check for the `usage` privilege on a schema. For example, to check if the current user can create objects in the “**public**” schema, run:

```sql
SELECT has_schema_privilege('cahyo', 'public', 'USAGE');
```

The query returns `TRUE`, which means the current user has `usage` privilege on the `public` schema.

```sql
 has_schema_privilege
----------------------
 t
```