Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wfheh-005bYj-0Z for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jul 2026 17:26:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wfhef-008hDT-3D for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jul 2026 17:26:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wfhef-008hDL-2F for pgsql-hackers@lists.postgresql.org; Fri, 03 Jul 2026 17:26:21 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wfhed-00000001LDc-34lx for pgsql-hackers@lists.postgresql.org; Fri, 03 Jul 2026 17:26:20 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-493bfe9f886so4458105e9.0 for ; Fri, 03 Jul 2026 10:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1783099578; x=1783704378; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to; bh=2+48bpP8oXyREgLIFmeokHi3DYIL/Wf/li+OGo5moYE=; b=OHGTI9IUCeVbd2m9hXCG6FCRZilgPUi5K3zPLbB6Z6AU8Z9U9crRzOr8cwUZAhkLFN x6l6zROPCeUuMDYITIQ0ZQEeZIbVj8iUqDPJXSRGGHiXRcrxvuKFzn3HCMyfFJiV4u2z sCMuC3buseF0Q0HZlZyQU3IRjMeojGBpj+8DNP0gnZKJGcOmApetFT2CjBOV3hgnP78V UFFHEFiEXK3X28ZMYWQUbkUyb+Y4vAt3kvOTUSOoPwgdXuihgLtK1rRN8kjFBTYFWVbS Z56PfZXSFysfwr/hKwSUgkYJ8AECh7jgKzmlVjdoxlczFERelz8+HZNzgQk9bzaMvuk8 /8yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783099578; x=1783704378; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2+48bpP8oXyREgLIFmeokHi3DYIL/Wf/li+OGo5moYE=; b=H2QEyU0k53/JNljeNWpEF4D2pSN089hRtY8Gc9yjdTnjooJkr1Fmc6mO76Fpv4K1oL jADt3kb7UaTh544PkD+RA3JpB/sPhEGHiAYuQ0qBe8rvOf73TNBQgolb6bC2EHUfEM6K WpBDCTLPCm9dBAme7qYXPRMD9tuGyMJNreWZxTj3L23hYgDCysJeMb589hdkT3U6e9Pc cLipu4yAdXvBavKfgN/8OuhGUA3ankPct55S/RUDY7cY1UK3zeXLh9h201YugwbnbbnY qATGsY8kjKc/LY2GNXisBrZeuLCerh/t82AMm6LAr4YP5zMRZsDvgMgvJfAjRXMs+s7x /PSg== X-Forwarded-Encrypted: i=1; AFNElJ9N8cOHSzirDCdp/9qEws/Xp/ln4UXEs3njzEfrxGrdiwfrIg4bWpuQx7z0c8dlmdDRKkuGs1QXe8r3YRAK@lists.postgresql.org X-Gm-Message-State: AOJu0YyyDgE9PVk/+zFDdwm1huG+s1PBuzdKD1xW+cOrpNENo5nqUkXG IhqgCMyRZp/Ja1PjuKqjoFCWlyOEXHQj/wWuJUqtuBlXxjCLIF43Gfhmf48qCEmcIkU= X-Gm-Gg: AfdE7ck5xCW696aHwRxI8IkSF55X84cL4uCT3VJcWd1hoW8KQ8hWMEM7fb50WQhF9Mb NvdvwS5xfw67tgDVcDlMNNp88m540VTtg08GA9AtJV0i0b8/G+W28WcOUGkYBLFZI6nGw7qWJXV EHqQ6+U0xeQo2IAU38ihIDtQLW1upg42fiMVpqwA5JV7CgWPd0xaomFL35uUAKW3Tcw5qlrl4VW 8N5TVGzphbLQ82xvIuX3+KbvME3jMXsveJ/XQOqU1nOcSCNGtSzL6DaigrbZW9KAwjAbpVHVVim nuieX0gVD38cReICqkcF9glZJGCUEawkiiT2MNbz51Iah+LC7zSfvJbZL1DAbJ7p3wuq4iO2JO7 s5aCoLM1g+WgOtImQs2XbtlQJenm/tCbYANcwZsEaNkbKQhtLIVatWy0tWSgFf4ODm1MK0fzSmA DTXk3oc0HgQzT8YECJx/wra4PGVy7ebm+IqB5R X-Received: by 2002:a05:600c:46d1:b0:493:c84c:2b57 with SMTP id 5b1f17b1804b1-493d11f7cdbmr2280535e9.29.1783099578190; Fri, 03 Jul 2026 10:26:18 -0700 (PDT) Received: from localhost (109-81-168-148.rct.o2.cz. [109.81.168.148]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493cce12c40sm105306285e9.13.2026.07.03.10.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 10:26:17 -0700 (PDT) From: Antonin Houska To: Alvaro Herrera cc: Ewan Young , PostgreSQL Hackers , mihailnikalayeu@gmail.com Subject: Re: REPACK CONCURRENTLY fails on tables with generated columns In-reply-to: References: Comments: In-reply-to Alvaro Herrera message dated "Fri, 03 Jul 2026 13:12:39 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <135098.1783099577.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Fri, 03 Jul 2026 19:26:17 +0200 Message-ID: <135099.1783099577@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera wrote: > On 2026-Jun-22, Ewan Young wrote: > = > > I applied the patch and ran it through an injection-point reproducer > > (cassert). Without the fix the bug reproduces (ERROR: no generation > > expression found for column number 3 ...); with it, REPACK CONCURRENTL= Y > > succeeds under a concurrent non-HOT UPDATE for a STORED generated colu= mn, an > > index directly on the generated column, and a VIRTUAL column, with cor= rect > > values afterwards. Your repack.spec change passes. > > = > > The approach is right and I've confirmed it fixes the bug, so +1 from = me in > > this direction. > = > Cool, thanks for reviewing -- I have pushed this fix, with some > stylistic changes and one bigger change: these catalog rows are only > needed in concurrent mode, so there was no reason to copy them in the > other case. So I restricted the copying to that case. Good point, thanks. > I've been looking at the other proposed change, and I agree with it. > Here's it, again with some style changes, and only one other proposed > change: for setting up updatedCols, ignore dropped columns. I don't > think this should change anything in practice, but it just feels wrong > to claim that a dropped column is being changed by an update. +1 -- = Antonin Houska Web: https://www.cybertec-postgresql.com