Re: 'ERROR: attempted to update invisible tuple' from 'ALTER INDEX ... ATTACH PARTITION' on parent index - Mailing list pgsql-hackers

From Robert Haas
Subject Re: 'ERROR: attempted to update invisible tuple' from 'ALTER INDEX ... ATTACH PARTITION' on parent index
Date
Msg-id CA+TgmoaPdohqdF5HDSr2fP6L5mL37LgzeyK7=vVL5RyY3SgwCQ@mail.gmail.com
Whole thread Raw
In response to Re: 'ERROR: attempted to update invisible tuple' from 'ALTER INDEX ... ATTACH PARTITION' on parent index  (Shruthi Gowda <gowdashru@gmail.com>)
Responses Re: 'ERROR: attempted to update invisible tuple' from 'ALTER INDEX ... ATTACH PARTITION' on parent index
List pgsql-hackers
On Wed, Jul 12, 2023 at 12:28 PM Shruthi Gowda <gowdashru@gmail.com> wrote:
>   I reviewed the function RelationReloadIndexInfo() and observed that the 'indisreplident' field and the
SelfItemPointer't_self' are not refreshed to the pg_index tuple of the index. 
>   Attached is the patch that fixes the above issue.

Oh, interesting. The fact that indisreplident isn't copied seems like
a pretty clear mistake, but I'm guessing that the fact that t_self
wasn't refreshed was deliberate and that the author of this code
didn't really intend for callers to look at the t_self value. We could
change our mind about whether that ought to be allowed, though. But,
like, none of the other tuple header fields are copied either... xmax,
xvac, infomask, etc.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: COPY table FROM STDIN via SPI
Next
From: Dave Cramer
Date:
Subject: CommandStatus from insert returning when using a portal.