agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Fix REPACK CONCURRENTLY for stored generated columns
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix REPACK CONCURRENTLY for stored generated columns
@ 2026-07-03 10:23  Álvaro Herrera <alvherre@kurilemu.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Álvaro Herrera @ 2026-07-03 10:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3be823486f2c9f405fc754ac0ece3ce412aee105

Modified Files
--------------
src/backend/commands/repack.c                      | 103 ++++++++++++++++++++-
.../modules/injection_points/specs/repack.spec     |   3 +-
2 files changed, 104 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix REPACK CONCURRENTLY for stored generated columns
@ 2026-07-03 10:23  Álvaro Herrera <alvherre@kurilemu.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Álvaro Herrera @ 2026-07-03 10:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_19_STABLE

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

Modified Files
--------------
src/backend/commands/repack.c                      | 103 ++++++++++++++++++++-
.../modules/injection_points/specs/repack.spec     |   3 +-
2 files changed, 104 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-07-03 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-07-03 10:23 pgsql: Fix REPACK CONCURRENTLY for stored generated columns Álvaro Herrera <alvherre@kurilemu.de>
2026-07-03 10:23 pgsql: Fix REPACK CONCURRENTLY for stored generated columns Álvaro Herrera <alvherre@kurilemu.de>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox