> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SET CATALOG

Sets the session's default *catalog*, in which table names that are not
qualified with a *catalog* then resolve.

> [!NOTE]
>
> This command is only available through
> [KiSQL](https://docs.kinetica.com/content/tools/kisql.md) or database clients configured with
> the [Kinetica JDBC driver](https://docs.kinetica.com/content/connectors/sql_guide.md#jdbc).

```sql title="SET CATALOG Syntax" theme={null}
SET CATALOG [=] <catalog name>
```

Setting the *catalog* to `KINETICA` restores the database itself as the
default.

While an external *catalog* is the default:

* A table name with no schema resolves in the *catalog's* `SCHEMA`
  option--see [Catalog Options](https://docs.kinetica.com/content/sql/ddl/create-catalog.md#sql-catalog-opts).
* A table name of the form `<schema>.<table>` resolves in the *catalog*.
* Common table expressions and the `ki_catalog`, `information_schema`,
  `pg_catalog` & `sys_*` schemas still resolve in the database.
* Only `SELECT`, `SHOW` & `DESCRIBE` statements are accepted; other
  statements are rejected until the default is set back to `KINETICA`.

## Examples

To make a JDBC *catalog* the session's default:

```sql SET CATALOG Example theme={null}
SET CATALOG jdbc_cat
```

A table name with no schema then resolves in the *catalog's* `SCHEMA`:

```sql Query Default Catalog Example theme={null}
SELECT COUNT(*) AS order_count
FROM orders
```

A *DDL* statement is rejected while an external *catalog* is the default:

```sql Rejected DDL Example theme={null}
CREATE TABLE example.fed_rejected (id INT)
```

```Rejected DDL Output theme={null}
[GPUdb]executeSql: SqlEngine: DDL is not supported while the default catalog is the external catalog 'jdbc_cat'; SET CATALOG KINETICA first (<REF>)
```

To restore the database itself as the default:

```sql Restore Default Catalog Example theme={null}
SET CATALOG KINETICA
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.