title | summary |
---|---|
SHOW CREATE PLACEMENT POLICY |
TiDB 数据库中 SHOW CREATE PLACEMENT POLICY 的使用概况。 |
SHOW CREATE PLACEMENT POLICY
语句可用于查看放置策略当前的定义,并在另一个 TiDB 集群中重新创建该策略。
ShowCreatePlacementPolicyStmt ::=
"SHOW" "CREATE" "PLACEMENT" "POLICY" PolicyName
PolicyName ::=
Identifier
{{< copyable "sql" >}}
CREATE PLACEMENT POLICY p1 PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4;
CREATE TABLE t1 (a INT) PLACEMENT POLICY=p1;
SHOW CREATE PLACEMENT POLICY p1\G
Query OK, 0 rows affected (0.08 sec)
Query OK, 0 rows affected (0.10 sec)
***************************[ 1. row ]***************************
Policy | p1
Create Policy | CREATE PLACEMENT POLICY `p1` PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4
1 row in set (0.00 sec)
该语句是 TiDB 对 MySQL 语法的扩展。