Re: Fix REPACK with WITHOUT OVERLAPS replica identity indexes

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix REPACK with WITHOUT OVERLAPS replica identity indexes
Date: 2026-05-11 06:54:18
Message-ID: 7DC152EA-F549-43D1-80ED-4ED2BB6F801E@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On May 10, 2026, at 06:38, Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
>
> On 2026-May-09, Chao Li wrote:
>
>>> On May 9, 2026, at 01:47, Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>>>
>>> On Fri, 8 May 2026 at 09:22, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
>>>> While testing UPDATE FOR PORTION OF, I started wondering whether
>>>> REPACK supports temporal tables. In theory, it should, because
>>>> temporal WITHOUT OVERLAPS indexes can be used as replica identity
>>>> indexes. So I created a test script, repack_temporal.spec, which is
>>>> included in the attached patch, and it failed.
>
> Nice find, thanks for testing.
>
>>>> I found that REPACK hard-codes BTEqualStrategyNumber when calling
>>>> get_opfamily_member(). That seems wrong, because
>>>> build_replindex_scan_key() uses IndexAmTranslateCompareType() to
>>>> get the equality strategy for COMPARE_EQ.
>
> Makes sense.
>
> I think it would be a good idea to make identity_key_equal() not deform
> all attributes, but instead only up to the last one it needs for the key
> comparisons.
>

That’s true. Please see v3.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment Content-Type Size
v3-0001-Fix-REPACK-with-WITHOUT-OVERLAPS-replica-identity.patch application/octet-stream 16.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ayush Tiwari 2026-05-11 06:57:43 Re: Plug-in coverage hole for pglz_decompress()
Previous Message Ashutosh Bapat 2026-05-11 06:39:24 Re: [PATCH] Clean up property graph error messages