pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees
Date: Wed, 24 Jan 2024 05:24:00 +0000
Message-ID: <E1rSVk0-002q04-AP@gemulon.postgresql.org> (raw)

Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees

This command, when used to add a column on a parent table with a complex
inheritance tree, tried to update multiple times the same tuple in
pg_attribute for a child table when incrementing attinhcount, causing
failures with "tuple already updated by self" because of a missing
CommandCounterIncrement() between two updates.

This exists for a rather long time, so backpatch all the way down.

Reported-by: Alexander Lakhin
Author: Tender Wang
Reviewed-by: Richard Guo
Discussion: https://postgr.es/m/18297-b04cd83a55b51e35@postgresql.org
Backpatch-through: 12

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bfec14d06de8d953260348b575f6645c1fb92f7f

Modified Files
--------------
src/backend/commands/tablecmds.c      |  4 ++++
src/test/regress/expected/inherit.out | 17 +++++++++++++++++
src/test/regress/sql/inherit.sql      |  9 +++++++++
3 files changed, 30 insertions(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1rSVk0-002q04-AP@gemulon.postgresql.org>
Permalink:  ../E1rSVk0-002q04-AP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rSVk0-002q04-AP@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix ALTER TABLE .. ADD COLUMN with complex inheritance trees
  In-Reply-To: <E1rSVk0-002q04-AP@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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