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 1x0HAF-004Yaf-26 for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Aug 2026 11:24:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x0HAE-00BAyl-22 for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Aug 2026 11:23:58 +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 1x0HAE-00BAyc-0u for pgsql-hackers@lists.postgresql.org; Sat, 29 Aug 2026 11:23:58 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x0HAC-00000002zOi-10f5 for pgsql-hackers@postgresql.org; Sat, 29 Aug 2026 11:23:57 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-482dd6ee390so1593877f8f.3 for ; Sat, 29 Aug 2026 04:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1788002633; x=1788607433; darn=postgresql.org; h=message-id:date:content-transfer-encoding:content-type:mime-version :comments:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to:content-type; bh=nFu2L+pgTzW7NbFxPGYs/SwoFREywwkIYj9TGZOiTcQ=; b=SInBbIG+H/KfZyaKLPeo8ONH750KvMk95F+AIRKE6A5l95YDxl4b+uXOz7HUv2gzL7 1UaHNlQmiMn0oelzIsgwLdYouq+Z6f6lKtCaUWEQ7TQJItiIt9N3oU1mfBUM9e0flazK ThTXzDLahUStJUMCXZ78s4Rgug5Vnn3oj8yncld18wq27uNbQa/ZQV22eAhEejceJ7CH 2qQA+ENpvBu4YGg/nfwZS/z4c0W4dNabr1Ud5GHQ8A+eTpUAwaFkZCCX9eQzzu0cvTcd 0E10Eu/OLukxZVvQO8oK+o2CoQe6YF+JdGP9F9p7LxCdtk1A8Jy20GTkA8ZgtdpsmApK kSTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788002633; x=1788607433; h=message-id:date:content-transfer-encoding:content-type: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 :content-type; bh=nFu2L+pgTzW7NbFxPGYs/SwoFREywwkIYj9TGZOiTcQ=; b=fIDbduJbU8bACH7XImIFKwcEIkhBeI2rHztfWc6IAnWkvHu4gyVC5M8aL3v+MkRQCZ Z6p9YpO+QXVYm+uXPQDStpGC5o8YkXmnJmZjhG1goNvuleGBXNNS8WWJXduqFVmwp8Mn CXGn9G8/Hxv/KOMhxIM+s9w3VGlSzggDyXRL/+QijX38eFw4eSKTbC7ZZhsLFCCai3LL aRj08QgbDJVFWVA477WfjAEVCOEO04iOu3KepbEPQCxiR9fKZi1DnZO+6zZRSb/PFrAj j/QbE8WfEPFD3TLETiJMus1oXJr1OWgwdw11qa+4f1AurMJj8AKOttH6YwLYr6c+YukC U5sQ== X-Forwarded-Encrypted: i=1; AKwUvBwjZk6lS9mO0hHNfGMR25XAcgtd/Fi34pcz7xx4A96Pdc4imU7L6vZAenpfFvltCKLF4l8ZHOQ1edvo32rh@postgresql.org X-Gm-Message-State: AFuF++mCa68s73o77tdB4ipxVlwPHgbBd1BJGg49hbQ5xK2WbtP27stF 8yYs64L3itLkemdX00Ad85sJVNkadboJc0ItNHSJDp3Cvo52tlp5bdklixPeVTFYKjs= X-Gm-Gg: AYBFou03HxF9ZBvVMSg1JbEKqs23Lm8F+9CKL2eg/RZyFVQIbAxp2L6vMF2wkN2kmwi qK3fzXHch4f9WSwYfjquy1ZZjs2QC68qlN5ZfP6iG9FLGcG0pIwugxs5+IZBszG05X6oK3+MfVL ejWuknarr6JdbkcnRcs6SPCVnyKv7IYYb29urpCjB74xOPGUDrafqpVQHwD52wEnFXVqE4dAvDQ P6Q4kd8NvwnKyXa2yBg2TGi4ntDCwnXR7wg2h7kELxYIK3pOybNA2+6bSWF11rfgVKQwQzvJ2iw ZqO1P2fI5003B7MzKxfwPTW7oSPz7Btsu6iRMzzJq/Qv2JsFzJJANgXOfdsj2QdZIf781w8L5+O GvJudCAANs4dr+Vg5ylUxNuR+fGOv0cahAqD0FTH54a9Ee86ERFWU7RXKfGLNTat2++t2T23NrJ gdD4Gog4CI/1dtuHOyKFfLkcfklHwmMxG23TyfJ9VtphNP1rI2aRqMjWRfx1/oRC2lSCX7qSVtI R0= X-Received: by 2002:a5d:5e02:0:b0:482:e2f2:19c1 with SMTP id ffacd0b85a97d-482f7975f7emr20006820f8f.2.1788002632937; Sat, 29 Aug 2026 04:23:52 -0700 (PDT) Received: from localhost (109-81-170-190.rct.o2.cz. [109.81.170.190]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482fbab3f22sm10181805f8f.2.2026.08.29.04.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2026 04:23:52 -0700 (PDT) From: Antonin Houska To: Bharath Rupireddy cc: Nathan Bossart , pgsql-hackers@postgresql.org, alvherre@kurilemu.de Subject: Re: REPACK (CONCURRENTLY) rewrites tables marked with user_catalog_table In-reply-to: References: Comments: In-reply-to Bharath Rupireddy message dated "Thu, 27 Aug 2026 15:46:10 -0700." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 29 Aug 2026 13:23:51 +0200 Message-ID: <8445.1788002631@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bharath Rupireddy wrote: > Hi, >=20 > On Thu, Aug 27, 2026 at 7:22=E2=80=AFAM Nathan Bossart wrote: > > > > IIUC this can cause problems for logical replication consumers, since t= he > > CONCURRENTLY path doesn't go through the rewriteheap.c machinery like t= he > > non-concurrent path does: > > > > CREATE TABLE t (a INT PRIMARY KEY, b TEXT) WITH (user_catalog_table= =3D true); > > ALTER TABLE t ALTER COLUMN b TYPE varchar(100); -- correctly fails > > REPACK (CONCURRENTLY) t; -- should fail but doesn't > > > > I believe the fix for v19 is to add a check for > > RelationIsUsedAsCatalogTable() in check_concurrent_repack_requirements() > > (plus a corresponding update to the list of CONCURRENTLY limitations in= the > > docs). >=20 > That's correct. I verified that concurrent repack doesn't write the > pg_logical/mappings files, which decoding later needs to correctly map > the old tuple locations to the new ones after a rewrite, unlike > non-concurrent CLUSTER, VACUUM FULL and REPACK on a user catalog > table. I think restricting user catalog tables, rather than making > concurrent repack support them, is the right choice at this point in > the release cycle. >=20 > Please find attached a patch with the suggested doc change. I didn't > add a test, I don't think we need one. Thanks! I'm just thinking about this comment: + /* The CONCURRENTLY path does not write logical rewrite mappings. */ IMO it makes no sense to rewrite the logical mappings as long as REPACK (CONCURRENTLY) changes visibility information (i.e. it's MVCC-unsafe). Once= we implement the MVCC-safety, we should not remove this check unless we implem= ent the rewriting of the mappings for user catalog tables - that might also be worth mentioning in the comment. So far, I'd consider the MVCC-unsafety the primary reason to prohibit REPACK (CONCURRENTLY) (or anyother MVCC-unsafe command) on the user catalog tables, because it can make the contents of those tables invisible to the output plugin at some point. --=20 Antonin Houska Web: https://www.cybertec-postgresql.com