Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update error content for PostgreSQL index-key-number rule (#4302)

rebelice33ad0cd5348b
diff --git a/plugin/advisor/pg/advisor_index_key_number_limit.go b/plugin/advisor/pg/advisor_index_key_number_limit.go
index 84dd8bc05f..1d880d4de2 100644
--- a/plugin/advisor/pg/advisor_index_key_number_limit.go
+++ b/plugin/advisor/pg/advisor_index_key_number_limit.go
@@ -108,7 +108,7 @@ func (checker *indexKeyNumberLimitChecker) Visit(node ast.Node) ast.Visitor {
Status: checker.level,
Code: advisor.IndexKeyNumberExceedsLimit,
Title: checker.title,
- Content: fmt.Sprintf("The number of index `%s` in table `%s` should be not greater than %d", index.indexName, index.tableName, checker.max),
+ Content: fmt.Sprintf("The number of keys of index %q in table %q should be not greater than %d", index.indexName, index.tableName, checker.max),
Line: index.line,
})
}
diff --git a/plugin/advisor/pg/test/index_key_number_limit.yaml b/plugin/advisor/pg/test/index_key_number_limit.yaml
index b150c4f700..44fb7feb61 100644
--- a/plugin/advisor/pg/test/index_key_number_limit.yaml
+++ b/plugin/advisor/pg/test/index_key_number_limit.yaml
@@ -24,14 +24,14 @@
- status: WARN
code: 802
title: index.key-number-limit
- content: The number of index `t_id_name` in table `t` should be not greater than 5
+ content: The number of keys of index "t_id_name" in table "t" should be not greater than 5
line: 1
- statement: CREATE TABLE t(id int, name char(225), c1 int, c2 int, c3 int, c4 int, CONSTRAINT t_id_name UNIQUE (id, name, c1, c2, c3, c4));
want:
- status: WARN
code: 802
title: index.key-number-limit
- content: The number of index `t_id_name` in table `t` should be not greater than 5
+ content: The number of keys of index "t_id_name" in table "t" should be not greater than 5
line: 1
- statement: |-
CREATE TABLE address(id int, phone varchar(225), c1 int, c2 int, c3 int, c4 int);
@@ -40,7 +40,7 @@
- status: WARN
code: 802
title: index.key-number-limit
- content: The number of index `idx_address_phone` in table `address` should be not greater than 5
+ content: The number of keys of index "idx_address_phone" in table "address" should be not greater than 5
line: 2
- statement: |-
CREATE TABLE address(id int, phone varchar(225), c1 int, c2 int, c3 int, c4 int);
@@ -49,7 +49,7 @@
- status: WARN
code: 802
title: index.key-number-limit
- content: The number of index `idx_address_phone` in table `address` should be not greater than 5
+ content: The number of keys of index "idx_address_phone" in table "address" should be not greater than 5
line: 2
- statement: |-
CREATE TABLE address(id int, phone varchar(225), c1 int, c2 int, c3 int, c4 int);
@@ -58,5 +58,5 @@
- status: WARN
code: 802
title: index.key-number-limit
- content: The number of index `address_id_name` in table `address` should be not greater than 5
+ content: The number of keys of index "address_id_name" in table "address" should be not greater than 5
line: 2