title | summary |
---|---|
SHOW CREATE PLACEMENT POLICY |
The usage of SHOW CREATE PLACEMENT POLICY in TiDB. |
SHOW CREATE PLACEMENT POLICY
is used to show the definition of a placement policy. This can be used to see the current definition of a placement policy and recreate it in another TiDB cluster.
Note:
This feature is not available on TiDB Cloud Serverless clusters.
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)
This statement is a TiDB extension to MySQL syntax.