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

# Rename a table with SQL

> Rename tables with ALTER TABLE, with namespace resolution and catalog restrictions.

Enterprise only

Use `ALTER TABLE ... RENAME TO ...` on a catalog that supports table renames:

```sql theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
ALTER TABLE orders RENAME TO archived_orders;
```

## Destination namespace

An unqualified destination inherits the source table's database and namespace,
even when the session uses a different default namespace. For example:

```sql theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
ALTER TABLE analytics.public.orders RENAME TO archived_orders;
```

The destination is `analytics.public.archived_orders`. Here, `public` denotes
the root namespace. A qualified destination can select another namespace in the
same database, subject to catalog support and permissions. Moving a table between
databases is rejected.

## Catalog restrictions

SQL uses the same authorization and rename operation as REST. Support depends on
the deployed server version and catalog:

* PostgreSQL-backed catalogs support table renames only in the root namespace.
* Manifest-backed databases support table renames within a namespace and across
  namespaces in the same database.
* Directory catalogs, including those with directory namespace manifests, reject
  table renames.
* Federated databases reject table renames.
* The system database is read-only.

A catalog refusal returns an error before table permissions are moved.


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