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.98.2) (envelope-from ) id 1xDzhn-00000000rD2-39ht for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Oct 2026 07:35:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xDzhm-0000000G0jf-3Gze for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Oct 2026 07:35:18 +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.98.2) (envelope-from ) id 1xDzhm-0000000G0jX-20OJ for pgsql-hackers@lists.postgresql.org; Tue, 06 Oct 2026 07:35:18 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xDzhk-00000000cA0-1cIs for pgsql-hackers@lists.postgresql.org; Tue, 06 Oct 2026 07:35:17 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-48c4d870d54so190195f8f.2 for ; Tue, 06 Oct 2026 00:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1791272115; x=1791876915; darn=lists.postgresql.org; h=message-id:date:content-id: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=BkprxVyeHvD14/B897S0qwKJ0ff2Ue+kDBqntUqJmhw=; b=hOC+EDNIH8RcEBMXlVBOg9H1qC/7VTVisHexalyetMPWWGn/yTVVlcg80M+SO1TGkI FDA4xVZZuZS5v5CC48mIqI0p+H6YOr7my03z4X2f3/CKZGE18/fsIi1lzLuIhOkBRhkW NMceL/X9l42LeQ3ISsKpsIcNUfvW5vG6b5JdmZZ9Keo+siB/45CPdU2w/a+H4Qz11Kam DLzf0U7AT6m/7h8Mol4XURAuU+6huAUOqAFqJfS3/GWNdn8vC+OqxFcEIZqJ0D32/4l+ tv1IA16mvAFqhn5ZugWtbo/pjdtE72CvLuAqWwAyYE9w3rvkqikqKeLsBFMpIU/2aatC 3iCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791272115; x=1791876915; h=message-id:date:content-id: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=BkprxVyeHvD14/B897S0qwKJ0ff2Ue+kDBqntUqJmhw=; b=BqeyOab2lDGNpp6keKQ/Z3XBRqkk0dTkeORO6Yyu3/avuSQYwW44f2qIBwo6nXBzJb 75bdEtT7ShMpNKhmPGit4xyPtlK1QTPDPk+8wxRF11Cp74EM5aljTeyNlf77/O72JaJL tgoRhvjVTpBej+Wul1n94AjvneVt1Gif5MX0hMqA6Dz9ePn1Ak0vI+kvx+cp6ExtH7MV sP5xDSPQH7Nu2T+mFG7OAiTL9P2403Z4yetBSbeHIj6Og20pJ0zHe3cmNftfVfkuStGA HjPP/WWZC3NfG1K0xMF4chfqrlA5iVlJNyS8fbdhX9yRMgWE9laWdxVzkhwnhUrECCv+ xf2w== X-Forwarded-Encrypted: i=1; AKwUvByVs1/JpiyQpgSitH30Ur1Fl/O8SBuYRlXPZEKPetSKsqhLA6MeKuJD9dgSiVZzMRd9YVCcTGhxw9vzCfn/@lists.postgresql.org X-Gm-Message-State: AFq9FYJCA9xMgLNmdcs6B/lTfRK0uQmdZ91tOnIiSMqP4BCueHjMqG/+ 80bPqGwRnO7rGfrhcqWRiQx8lCThQhCc7s4NvZwihl5gy7UqKc8eP891rbb4+H2JEuRN6oaTIW0 vBZSH8ek= X-Gm-Gg: AYBFou3usA1RD8ZNrXjwLdL8qU+lRHzr3GFSKzQYckyXlS50IMSN1I5/cKcjB6Vfa6q vUcv3BoicoufAi6O/PCxmRWWayTtGpkYuf1SbmNw6FHZC1ZUn3WR6pJEfg/OUJsyVvFCF54wkDi G930IjR55jGJVW+2qw14bUYOUfWU826NlRL2vBjx8tBTWawEsQ9YENLgP13neyMAsnpjqCTyCEj KZlaa3u8s+E9FXrexDmkk+jKSvrdFecMwpU74U06GPlKRjgXenZ+Nw1Xvz1HBvnKQ6UDQQ0Em4V XfWrrjBSZ9DnnfyBdxOqc3KO2kKe1nwWcEbHW1nc0Dbd2RG6HSpwbUqDzMSmL3dvrHPxLJpsWib 6gzrgKHb0hruEFndE9X9C7mM1cnVcmNT5GoawO0dAEPlNNPlrkvLn0Pq/q4quNg+vZe/K0/yQ1p jOhSAFQWyR1+tjvG9//Ybr6J9EVuBxzaVp2yk/NsYYctLSxlB00iG3oe5MZiFB7smGh1/AJaR+Y ZoR1eXoPQ== X-Received: by 2002:a05:6000:260d:b0:487:1c89:f158 with SMTP id ffacd0b85a97d-48c6d1615a5mr943916f8f.14.1791272114789; Tue, 06 Oct 2026 00:35:14 -0700 (PDT) Received: from localhost (109-81-170-16.rct.o2.cz. [109.81.170.16]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48c69be6b12sm3204008f8f.45.2026.10.06.00.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2026 00:35:14 -0700 (PDT) From: Antonin Houska To: shihao zhong cc: Alvaro Herrera , Fujii Masao , Radim Marek , PostgreSQL Hackers Subject: Re: REPACK (CONCURRENTLY) might keep dropped-column data In-reply-to: References: Comments: In-reply-to shihao zhong message dated "Mon, 05 Oct 2026 11:46:54 -0400." 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: <12437.1791272113.1@localhost> Date: Tue, 06 Oct 2026 09:35:13 +0200 Message-ID: <12438.1791272113@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk shihao zhong wrote: > A replayed INSERT can carry a dropped column's value too, and that > path still stores it. > > A BEFORE INSERT trigger that returns a copy of > an existing row does it: > > r := (SELECT t FROM demo t WHERE id = 1); > r.id := NEW.id; > RETURN r; > > So does an UPDATE that moves the row to another partition while the > trigger returns OLD. COPY, MERGE and INSERT ON CONFLICT go the same > way. > It can also make REPACK fail. If the columns that are left need no > TOAST table, the new heap has none, and on master I get: > > ERROR: row is too big: size 16424, maximum size 8160 Can you please be more specific about this? I don't understand why the new heap has no TOAST relation in such a case. Perhaps a bug in see heapam_relation_needs_toast_table()? I'm not sure it should return here, regardless the tuple size. if (!has_toastable_attrs) return false; /* nothing to toast? */ > 0001 clears dropped columns in restore_tuple(), so every kind of > change is covered, and the block added to prepare_concurrent_update() > is no longer needed. Is this needed even for DELETE? -- Antonin Houska Web: https://www.cybertec-postgresql.com