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

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Cc: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.
Date: 2021-02-09 19:41:16
Message-ID: CALNJ-vRKTYa5bNsXDbqca0PG6W7stv-bxxhWTN6D8NQt+viQBw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
Minor comment:

+ if (errflag == true)
+ ereport(ERROR,

I think 'if (errflag)' should suffice.

Cheers

On Tue, Feb 9, 2021 at 10:44 AM Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
wrote:

> вт, 9 февр. 2021 г. в 01:46, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>:
>
>>
>>
>> > On Feb 8, 2021, at 2:46 AM, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
>> wrote:
>> >
>> > 0002 - is a temporary hack for testing. It will allow inserting
>> duplicates in a table even if an index with the exact name "idx" has a
>> unique constraint (generally it is prohibited to insert). Then a new
>> amcheck will tell us about these duplicates. It's pity but testing can not
>> be done automatically, as it needs a core recompile. For testing I'd
>> recommend a protocol similar to the following:
>> >
>> > - Apply patch 0002
>> > - Set autovaccum = off in postgresql.conf
>>
>> Thanks Pavel and Anastasia for working on this!
>>
>> Updating pg_catalog directly is ugly, but the following seems a simpler
>> way to set up a regression test than having to recompile. What do you
>> think?
>>
>> Very nice idea, thanks!
> I've made a regression test based on it. PFA v.2 of a patch. Now it
> doesn't need anything external for testing.
>
> --
> Best regards,
> Pavel Borisov
>
> Postgres Professional: http://postgrespro.com <http://www.postgrespro.com>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2021-02-09 20:08:21 Re: [POC] verifying UTF-8 using SIMD instructions
Previous Message Pavel Borisov 2021-02-09 18:57:34 Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.