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 1w0Udq-001xAA-38 for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2026 01:15:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0Udo-00CmEx-0w for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2026 01:15:08 +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 1w0Udn-00CmEp-35 for pgsql-hackers@lists.postgresql.org; Thu, 12 Mar 2026 01:15:08 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0: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 1w0Udl-00000001hHl-0dH5 for pgsql-hackers@lists.postgresql.org; Thu, 12 Mar 2026 01:15:07 +0000 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-82995242934so622126b3a.0 for ; Wed, 11 Mar 2026 18:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773278104; x=1773882904; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5MLa7F6oVS2tFNW7kudbUkKH9wv7Qi1jb6YguPRs+Cg=; b=XdihwjL1/3T6raXQq+qJiwaPc+hb99xyTXlaL+ZVxI+DRLZLaQDWXH912DTI1+dKtg u7+7LOiEH7cWHOuaNhyP8L2GZ9AeMN/NtOmCvMbGyyQTsA2pJe7fUDv2L3prULnXx3l/ 4T55GRYq4/rhZS3uHhZ3uz0M6kUwdz4JGQmUONSGL6dpeftFicTrCXCS6nUjzmp7wErJ UygpRKkNq8cm7Vk+dd05fMdNKYvj1tc5KwWSV5eUmFlaIE0hash/zuJIGKpacm1vMjLt ujxQ5OPEy4Ysv8vkLup6wMc2qasDNvtVmadFfsbJ+PDLLv2ZDlIMfBi3KEHKK6c1tcAa giZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773278104; x=1773882904; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5MLa7F6oVS2tFNW7kudbUkKH9wv7Qi1jb6YguPRs+Cg=; b=L7SqPAxn271UZuCQzqXnJLD/8pHzYurg/x4WEWrEKATJJUVy73h79qCfW0ahj4OM1w JIkzDHVHKDfWkOJkUqAAJ5sxB+ROnWeSUAvsmQWrQg5G2+Pt2wHh7rff3/2FtQUAvRtW EzVXBy2fZOGd1m2fhzVFHvc9rJkZkBA2s/oWHLjyyFwmxZKb/vRLSpIpEGLbTs5V0Xsk oBfYMwaKUuyAI2Z3NKRa32aluTFfz/TVaOt7m83YNJq6hdcQbzCegy+XryJnrq+T2mFo 0j7ZQCQ1RoSkRDObrUK0gv98shrboJnD1H1MqN27VDPGNSMBMxkfB4VfgWYYFZGEjE0j /YJQ== X-Forwarded-Encrypted: i=1; AJvYcCXuvAZP/D/11bqMSdq+xTx6hU/3MCOIs3rsA00N90Wx8fHtPQ6TlZcnvF8jUqkRUA2Y/Zr9sBRQ2dRG+0yQ@lists.postgresql.org X-Gm-Message-State: AOJu0YzlQvokGOsNTw2uH5iYNd4fKGBxEuaFxbTPtJhmLMi0ryIFtEWP MEE0fp1h5Ff3KGjIFDhhmB7jp0teEMoQ6MhjiC/etRDA4DCieCbGgGyh X-Gm-Gg: ATEYQzzj4pHD/QlsCIlJxF+MpmMJeR7YrIp3uJj8YNeEDN4fU7pbUGuxNOqG3/R7YaD bPUMHZKbzSJk8izoLWOwfQNMds/Y6eLhGJN1m31SH2+RCo8By1QZcYD97LvNJZnoyi85ff1nTfs 5f9feEV471AO5TZxm2wCjU7/4I/hYYW4ZskXZCgfZDnGhVreTCbvUBIRAbTCg90cAXRxZBVW4MS se+y0gaP6/NhFIHWYKra1GJ26+pmSqdMnL4TcP4PBpjyDsc0gj7RaXZuudDcJOk+HCpdCksi17N 5G7uraRZeV7U1IJS5C5/ASpw3MB8mVg/ir1ztAzMwPgbPEfSRcpiqln827+M5pwMGAoR4MXPbES 1UYZg4G1BDppU8e9+7QDRFZhXJBVeN1BvbZYIGv8rbNnz6g6AZsjtqx+8NvbLHoxMOb22VP3bzH bXsCxZLlDa4cMPXpd54ytpSPHu7yqRtGQ= X-Received: by 2002:a05:6a00:2ea4:b0:827:2ee7:baaf with SMTP id d2e1a72fcca58-82a071c9ac0mr1367349b3a.12.1773278104054; Wed, 11 Mar 2026 18:15:04 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82a07365090sm910851b3a.46.2026.03.11.18.15.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2026 18:15:03 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: ALTER TABLE: warn when actions do not recurse to partitions From: Chao Li In-Reply-To: Date: Thu, 12 Mar 2026 09:14:20 +0800 Cc: Jim Jones , "David G. Johnston" , Postgres hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <6eff5e43-cacd-4a2a-ad1d-e3b313c86050@uni-muenster.de> <950BB7B5-0180-4C36-82A0-7E17B920F740@gmail.com> <8ECD9403-F0BB-4971-94CF-2709EEB4E3B9@gmail.com> <9174F0CF-2F70-4B4F-AED4-CAF113B7F093@gmail.com> <14669a83-c7b4-4cdf-890c-dceecd025ee1@uni-muenster.de> <3F59D90E-9A47-4C1C-B330-D62D668A462E@gmail.com> <5e01263a-1994-44d5-9e98-7212acf9c985@uni-muenster.de> To: Greg Sabino Mullane X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Mar 12, 2026, at 00:39, Greg Sabino Mullane = wrote: >=20 > On Wed, Mar 11, 2026 at 3:05=E2=80=AFAM Chao Li = wrote: > Are you concerning that rendering the full message text is the extra = work? This is not a hot path, so I don=E2=80=99t think that would be a = big deal. Actually, adding two more fields sounds more expensive >=20 > Well, the recurring creation and freeing of the strings is the part = that seems inefficient. But you don't even need to store the strings at = all if you are tracking the action+rel. In such a case, the final = strings can be created on the fly inside of = EmitPartitionNoRecurseNotice, right? Then you just need a list to store = the combos of action+relation. >=20 Fully understood your point. My considerations are: * This is not on a hot path, and that=E2=80=99s a very trivial = performance impact. * I would believe in most of use cases, ALTER TABLE won=E2=80=99t take = duplicate sub-commands, thus duplicated messages should rarely happen. * If we take your approach, actually, we don=E2=80=99t have to store = action+relation in the list, only action is okay. But, if we defer = building the notice message to EmitPartitionNoRecurseNotice, then we = have to leave relation open till EmitPartitionNoRecurseNotice, which = feels a worse burden. Looking at ATController(), rel is closed early. An = alternative is to store the relation name in a temp variable, which also = introduces extra code. As a trade-off, I think building the notice = message in CollectPartitionNoRecurseNotice() is an easy implementation. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/