pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Teach contrib/amcheck to check the unique constraint violation
6+ messages / 4 participants
[nested] [flat]

Commits from this thread:
  2023-10-30 675fed4df5  Fix indentation in contrib/amcheck/verify_nbtree.c
* pgsql: Teach contrib/amcheck to check the unique constraint violation
@ 2023-10-27 21:21 Alexander Korotkov <akorotkov@postgresql.org>
  2023-10-30 07:17 ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 6+ messages in thread

From: Alexander Korotkov @ 2023-10-27 21:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Teach contrib/amcheck to check the unique constraint violation

Add the 'checkunique' argument to bt_index_check() and bt_index_parent_check().
When the flag is specified the procedures will check the unique constraint
violation for unique indexes.  Only one heap entry for all equal keys in
the index should be visible (including posting list entries).  Report an error
otherwise.

pg_amcheck called with the --checkunique option will do the same check for all
the indexes it checks.

Author: Anastasia Lubennikova <lubennikovaav@gmail.com>
Author: Pavel Borisov <pashkin.elfe@gmail.com>
Author: Maxim Orlov <orlovmg@gmail.com>
Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com>
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>
Reviewed-by: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>
Discussion: https://postgr.es/m/CALT9ZEHRn5xAM5boga0qnrCmPV52bScEK2QnQ1HmUZDD301JEg%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5ae2087202af9fd804c8b8d76954bdd8bdf31e51

Modified Files
--------------
contrib/amcheck/Makefile                      |   2 +-
contrib/amcheck/amcheck--1.3--1.4.sql         |  29 +++
contrib/amcheck/amcheck.control               |   2 +-
contrib/amcheck/expected/check_btree.out      |  42 ++++
contrib/amcheck/meson.build                   |   2 +
contrib/amcheck/sql/check_btree.sql           |  14 ++
contrib/amcheck/t/004_verify_nbtree_unique.pl | 244 +++++++++++++++++++
contrib/amcheck/verify_nbtree.c               | 330 ++++++++++++++++++++++++--
doc/src/sgml/amcheck.sgml                     |  14 +-
doc/src/sgml/ref/pg_amcheck.sgml              |  11 +
src/bin/pg_amcheck/pg_amcheck.c               |  48 +++-
src/bin/pg_amcheck/t/003_check.pl             |  50 ++++
src/bin/pg_amcheck/t/005_opclass_damage.pl    |  65 +++++
13 files changed, 830 insertions(+), 23 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Teach contrib/amcheck to check the unique constraint violation
  2023-10-27 21:21 pgsql: Teach contrib/amcheck to check the unique constraint violation Alexander Korotkov <akorotkov@postgresql.org>
@ 2023-10-30 07:17 ` Michael Paquier <michael@paquier.xyz>
  2023-10-30 08:35   ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Alexander Korotkov <aekorotkov@gmail.com>
  2023-10-30 18:52   ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Bruce Momjian <bruce@momjian.us>
  0 siblings, 2 replies; 6+ messages in thread

From: Michael Paquier @ 2023-10-30 07:17 UTC (permalink / raw)
  To: Alexander Korotkov <akorotkov@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

Hi Alexander,

On Fri, Oct 27, 2023 at 09:21:50PM +0000, Alexander Korotkov wrote:
> Teach contrib/amcheck to check the unique constraint violation
> 
> Add the 'checkunique' argument to bt_index_check() and bt_index_parent_check().
> When the flag is specified the procedures will check the unique constraint
> violation for unique indexes.  Only one heap entry for all equal keys in
> the index should be visible (including posting list entries).  Report an error
> otherwise.
> 
> pg_amcheck called with the --checkunique option will do the same check for all
> the indexes it checks.

koel is unhappy with the indentation done in this commit.  See the
parts about verify_nbtree.c and pg_amcheck.c:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=koel&dt=2023-10-30%2007%3A04%3A04
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Teach contrib/amcheck to check the unique constraint violation
  2023-10-27 21:21 pgsql: Teach contrib/amcheck to check the unique constraint violation Alexander Korotkov <akorotkov@postgresql.org>
  2023-10-30 07:17 ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Michael Paquier <michael@paquier.xyz>
@ 2023-10-30 08:35   ` Alexander Korotkov <aekorotkov@gmail.com>
  2023-10-30 22:36     ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Michael Paquier <michael@paquier.xyz>
  1 sibling, 1 reply; 6+ messages in thread

From: Alexander Korotkov @ 2023-10-30 08:35 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Alexander Korotkov <akorotkov@postgresql.org>; pgsql-committers@lists.postgresql.org

On Mon, Oct 30, 2023 at 9:18 AM Michael Paquier <michael@paquier.xyz> wrote:
> On Fri, Oct 27, 2023 at 09:21:50PM +0000, Alexander Korotkov wrote:
> > Teach contrib/amcheck to check the unique constraint violation
> >
> > Add the 'checkunique' argument to bt_index_check() and bt_index_parent_check().
> > When the flag is specified the procedures will check the unique constraint
> > violation for unique indexes.  Only one heap entry for all equal keys in
> > the index should be visible (including posting list entries).  Report an error
> > otherwise.
> >
> > pg_amcheck called with the --checkunique option will do the same check for all
> > the indexes it checks.
>
> koel is unhappy with the indentation done in this commit.  See the
> parts about verify_nbtree.c and pg_amcheck.c:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=koel&dt=2023-10-30%2007%3A04%3A04

Fixed, thank you for catching it!

------
Regards,
Alexander Korotkov





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Teach contrib/amcheck to check the unique constraint violation
  2023-10-27 21:21 pgsql: Teach contrib/amcheck to check the unique constraint violation Alexander Korotkov <akorotkov@postgresql.org>
  2023-10-30 07:17 ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Michael Paquier <michael@paquier.xyz>
  2023-10-30 08:35   ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Alexander Korotkov <aekorotkov@gmail.com>
@ 2023-10-30 22:36     ` Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2023-10-30 22:36 UTC (permalink / raw)
  To: Alexander Korotkov <aekorotkov@gmail.com>; +Cc: Alexander Korotkov <akorotkov@postgresql.org>; pgsql-committers@lists.postgresql.org

On Mon, Oct 30, 2023 at 10:35:40AM +0200, Alexander Korotkov wrote:
> Fixed, thank you for catching it!

Thanks.  Note that this is a two-step process, though.  Commits done
to fix indentation should also be added to .git-blame-ignore-revs.
The file has intructions about how to do it.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Teach contrib/amcheck to check the unique constraint violation
  2023-10-27 21:21 pgsql: Teach contrib/amcheck to check the unique constraint violation Alexander Korotkov <akorotkov@postgresql.org>
  2023-10-30 07:17 ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Michael Paquier <michael@paquier.xyz>
@ 2023-10-30 18:52   ` Bruce Momjian <bruce@momjian.us>
  2023-10-30 22:38     ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Michael Paquier <michael@paquier.xyz>
  1 sibling, 1 reply; 6+ messages in thread

From: Bruce Momjian @ 2023-10-30 18:52 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Alexander Korotkov <akorotkov@postgresql.org>; pgsql-committers@lists.postgresql.org

On Mon, Oct 30, 2023 at 04:17:52PM +0900, Michael Paquier wrote:
> Hi Alexander,
> 
> On Fri, Oct 27, 2023 at 09:21:50PM +0000, Alexander Korotkov wrote:
> > Teach contrib/amcheck to check the unique constraint violation
> > 
> > Add the 'checkunique' argument to bt_index_check() and bt_index_parent_check().
> > When the flag is specified the procedures will check the unique constraint
> > violation for unique indexes.  Only one heap entry for all equal keys in
> > the index should be visible (including posting list entries).  Report an error
> > otherwise.
> > 
> > pg_amcheck called with the --checkunique option will do the same check for all
> > the indexes it checks.
> 
> koel is unhappy with the indentation done in this commit.  See the
> parts about verify_nbtree.c and pg_amcheck.c:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=koel&dt=2023-10-30%2007%3A04%3A04

Thanks, ran pgindent fix commits de64268561 and 5ae2087202a.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Teach contrib/amcheck to check the unique constraint violation
  2023-10-27 21:21 pgsql: Teach contrib/amcheck to check the unique constraint violation Alexander Korotkov <akorotkov@postgresql.org>
  2023-10-30 07:17 ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Michael Paquier <michael@paquier.xyz>
  2023-10-30 18:52   ` Re: pgsql: Teach contrib/amcheck to check the unique constraint violation Bruce Momjian <bruce@momjian.us>
@ 2023-10-30 22:38     ` Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2023-10-30 22:38 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Alexander Korotkov <akorotkov@postgresql.org>; pgsql-committers@lists.postgresql.org

On Mon, Oct 30, 2023 at 02:52:55PM -0400, Bruce Momjian wrote:
> Thanks, ran pgindent fix commits de64268561 and 5ae2087202a.

Thanks, Bruce.  Note that this is a two-step process.  Commits done to
fix indentation should also be added to .git-blame-ignore-revs.  The
file has intructions about how to do it.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2023-10-30 22:38 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-10-27 21:21 pgsql: Teach contrib/amcheck to check the unique constraint violation Alexander Korotkov <akorotkov@postgresql.org>
2023-10-30 07:17 ` Michael Paquier <michael@paquier.xyz>
2023-10-30 08:35   ` Alexander Korotkov <aekorotkov@gmail.com>
2023-10-30 22:36     ` Michael Paquier <michael@paquier.xyz>
2023-10-30 18:52   ` Bruce Momjian <bruce@momjian.us>
2023-10-30 22:38     ` Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox