]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix REPACK CONCURRENTLY for stored generated columns
authorÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 3 Jul 2026 10:22:37 +0000 (12:22 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 3 Jul 2026 10:22:37 +0000 (12:22 +0200)
commit3be823486f2c9f405fc754ac0ece3ce412aee105
tree07ad5850955eaaf598fe2f12dfefabed57bc8b5c
parent7afa11feca6c4e48d01890580564d55cf226fe02
Fix REPACK CONCURRENTLY for stored generated columns

In order to replay concurrent changes, REPACK CONCURRENTLY needs the
pg_attrdef tuples for the transient table to be there, in case a tuple
is modified concurrently with REPACK and requires to store the value
from the generated column (which, with the current arrangements, means
all tuples concurrently updated or inserted).  Fix by creating a copy of
them from the original table.  Add a test that tickles the bug.

Author: Antonin Houska <ah@cybertec.at>
Reported-by: Ewan Young <kdbase.hack@gmail.com>
Diagnosed-by: Ewan Young <kdbase.hack@gmail.com>
Reviewed-by: Ewan Young <kdbase.hack@gmail.com>
Backpatch-through: 19
Discussion: https://postgr.es/m/CAON2xHMrELwx9vKg6niSf8fMBA=-MGXmG=MPQU6+vMVhGjF8kQ@mail.gmail.com
src/backend/commands/repack.c
src/test/modules/injection_points/specs/repack.spec