Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.

From: Karina Litskevich <litskevichkarina(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, Maxim Orlov <orlovmg(at)gmail(dot)com>, lubennikovaav(at)gmail(dot)com, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>
Subject: Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.
Date: 2022-09-08 13:29:16
Message-ID: CACiT8iYi5HKksUenN2D+BxUGKvpRxuVdR37PWGwvDDea2OO6Tg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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/

Attachment Content-Type Size
v16-0001-Add-option-for-amcheck-and-pg_amcheck-to-check-u.patch text/x-patch 43.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-09-08 13:29:20 Re: Bump MIN_WINNT to 0x0600 (Vista) as minimal runtime in 16~
Previous Message Peter Eisentraut 2022-09-08 13:25:01 Re: [PoC] Let libpq reject unexpected authentication requests