pingcap / pingcap/tidb

Add support to Schema/Database rename

Open
#54,251 0 comments 2 reactions 0 assignees View on GitHub
type/feature-request
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Feature Request

**Is your feature request related to a problem? Please describe:**
Postgres provides schema rename by the commands: ALTER SCHEMA schema_name RENAME TO new_name;
However, TiDB doesn't support any schema renaming. The schema rename feature is needed to implement soft delete.

**Describe the feature you'd like:**
Extend ALTER DATABASE and provide schema rename feature.

**Describe alternatives you've considered:**
One alternative is to create a new schema with the new name, and rename all tables in the old database to be in the new database. However, for schemas with tons of tables this will be a super lengthy process.

**Teachability, Documentation, Adoption, Migration Strategy:**
ALTER DATABASE schema_name RENAME TO new_name;

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.