# pg_namespace

> 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: pg_namespace
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/system-catalogs/catalogs/pg_namespace
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/system-catalogs/catalogs/pg_namespace.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/system-catalogs/catalogs/pg_namespace.adoc
description: The pg_namespace contains information about schema definitions.
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/system-catalogs/catalogs/pg_namespace.md -->

The `pg_namespace` contains information about schema definitions. It mimics the [pg\_namespace](https://www.postgresql.org/docs/current/catalog-pg-namespace.html) PostgreSQL system catalog.

> 📝 **NOTE**
>
> To learn more about Schema and how it is managed in Redpanda SQL, see the [schema documentation](https://docs.redpanda.com/cloud-data-platform/reference/sql/schema/).

## [](#columns)Columns

The `pg_namespace` catalog has the following key columns:

| Column | Type | Description |
| --- | --- | --- |
| oid | int | This column represents the Object ID, a unique identifier assigned to each namespace |
| nspname | text | This column represents the name of the namespace |
| nspowner | int | This column represents the owner of the namespace |
| nspacl | text | unused |

## [](#examples)Examples

### [](#create-a-schema)Create a schema

In this example, the “sales” and “hr” schemas are created using the following query:

```sql
CREATE SCHEMA sales;
CREATE SCHEMA hr;
```

The successful result would look like this:

```sql
COMPLETE
COMPLETE
```

### [](#view-schema-definitions)View schema definitions

Use a `SELECT` statement on the `pg_namespace` catalog to show the schema definitions.

```sql
SELECT nspname AS schema_name, oid AS schema_oid
FROM pg_namespace;
```

The result shows the list of schemas and their IDs:

```sql
 schema_name | schema_oid
-------------+------------
 public      |          0
 sales       |          3
 hr          |          4
```