SHOW CREATE PLACEMENT POLICY

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.

SHOW CREATE PLACEMENT POLICY - 图1

Note

This feature is not available on TiDB Serverless clusters.

Synopsis

ShowCreatePlacementPolicyStmt

SHOW CREATE PLACEMENT POLICY - 图2

PolicyName

SHOW CREATE PLACEMENT POLICY - 图3

  1. ShowCreatePlacementPolicyStmt ::=
  2. "SHOW" "CREATE" "PLACEMENT" "POLICY" PolicyName
  3. PolicyName ::=
  4. Identifier

Examples

  1. CREATE PLACEMENT POLICY p1 PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4;
  2. CREATE TABLE t1 (a INT) PLACEMENT POLICY=p1;
  3. SHOW CREATE PLACEMENT POLICY p1\G
  1. Query OK, 0 rows affected (0.08 sec)
  2. Query OK, 0 rows affected (0.10 sec)
  3. ***************************[ 1. row ]***************************
  4. Policy | p1
  5. Create Policy | CREATE PLACEMENT POLICY `p1` PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4
  6. 1 row in set (0.00 sec)

MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

See also