Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.
Karina Litskevich <litskevichkarina@gmail.com>
From: Karina Litskevich <litskevichkarina@gmail.com>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>, Pavel Borisov <pashkin.elfe@gmail.com>, Maxim Orlov <orlovmg@gmail.com>,
lubennikovaav@gmail.com, Mark Dilger <mark.dilger@enterprisedb.com>, Peter Geoghegan <pg@bowt.ie>, Aleksander Alekseev <aleksander@timescale.com>,
Dmitry Koval <d.koval@postgrespro.ru>
Date: 2022-09-08T13:29:16Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
amcheck: Optimize speed of checking for unique constraint violation
- cdd6ab9d1f53 18.0 landed
-
amcheck: Report an error when the next page to a leaf is not a leaf
- 97e5b0026fc2 17.0 landed
-
amcheck: Don't load the right sibling page into BtreeCheckState
- 0b5c16124811 17.0 landed
-
amcheck: Refactoring the storage of the last visible entry
- 532d94fec32a 17.0 landed
-
Teach contrib/amcheck to check the unique constraint violation
- 5ae2087202af 17.0 landed
-
Add macros in hash and btree AMs to get the special area of their pages
- d16773cdc862 15.0 cited
Attachments
- v16-0001-Add-option-for-amcheck-and-pg_amcheck-to-check-u.patch (text/x-patch) patch v16-0001
Hi,
I also would like to suggest a cosmetic change.
In v15 a new field checkunique is added after heapallindexed and before
no_btree_expansion fields in struct definition, but in initialisation it is
added after no_btree_expansion:
--- a/src/bin/pg_amcheck/pg_amcheck.c
+++ b/src/bin/pg_amcheck/pg_amcheck.c
@@ -102,6 +102,7 @@ typedef struct AmcheckOptions
bool parent_check;
bool rootdescend;
bool heapallindexed;
+ bool checkunique;
/* heap and btree hybrid option */
bool no_btree_expansion;
@@ -132,7 +133,8 @@ static AmcheckOptions opts = {
.parent_check = false,
.rootdescend = false,
.heapallindexed = false,
- .no_btree_expansion = false
+ .no_btree_expansion = false,
+ .checkunique = false
};
I suggest to add checkunique field between heapallindexed and
no_btree_expansion fields in initialisation as well as in definition:
@@ -132,6 +133,7 @@ static AmcheckOptions opts = {
.parent_check = false,
.rootdescend = false,
.heapallindexed = false,
+ .checkunique = false,
.no_btree_expansion = false
};
--
Best regards,
Litskevich Karina
Postgres Professional: http://postgrespro.com/