Re: Bug: Whole-row var in indexes corrupts indexes after DDL

From: Matthias van de Meent <boekewurm(at)gmail(dot)com>
To: Clemenza Zhang <zxlmgsps2(at)gmail(dot)com>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: Bug: Whole-row var in indexes corrupts indexes after DDL
Date: 2026-09-09 10:44:19
Message-ID: CAEze2WhgWxZx_1XyHE75CbxeTLWWwPUEq=112S-5TWaH5wMAkw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Please avoid top-posting replies, it makes it difficult to get the
context of what you're replying to.

On Wed, 9 Sept 2026 at 07:23, Clemenza Zhang <zxlmgsps2(at)gmail(dot)com> wrote:
> So I have not found any new correctness issue in these tests.
>
> One possible test-coverage suggestion: the current indexing regression
> test checks that relfilenode changes after ADD COLUMN, ALTER TYPE, and
> DROP COLUMN. It might be worth also checking the result of an actual
> lookup through the rebuilt expression index, since stale index contents
> were the user-visible failure mode of the original bug.

As I mentioned upthread, I think it's sufficient to check that the
index was rebuilt, because there are no signs that the index
insertion's expression evaluation code itself is broken for whole-row
expressions, and because index rebuilds use a tablescan for the new
index data and not the old data of the index being rebuilt.

> Likewise, since v4 adds OBJECT_WHOLE_ROW specifically to address the
> object-address issue, the table whole-row round-trip case might be
> worth adding to the object-address regression tests.

Attached version 5 includes updated object_address.sql tests.

Kind regards,

Matthias van de Meent
Databricks (https://www.databricks.com)

Attachment Content-Type Size
v5-0001-Track-whole-row-Var-dependencies-in-pg_depend.patch application/octet-stream 37.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Grigorev Jurij 2026-09-09 10:56:34 Re: DSA_ALLOC_NO_OOM vs dsm_create ERROR leaving a half-initialized pgstats hash entry
Previous Message Hayato Kuroda (Fujitsu) 2026-09-09 10:33:39 RE: pg_createsubscriber does not check output_plugin_libraries