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 1wBuy1-001Us6-0U for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Apr 2026 13:35:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBuxy-002Nso-1F for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Apr 2026 13:35:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBuxy-002Nsg-09 for pgsql-hackers@lists.postgresql.org; Sun, 12 Apr 2026 13:35:11 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wBuxu-00000000fob-2F3e for pgsql-hackers@lists.postgresql.org; Sun, 12 Apr 2026 13:35:10 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-43d70c30767so349391f8f.0 for ; Sun, 12 Apr 2026 06:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776000905; cv=none; d=google.com; s=arc-20240605; b=hNbRcJacry6G7leMPgHeIm615NLlPfEfujL1fhsHuMyOkTsdC1vk3CxYHC5zUQxOZ0 tUfjGVHm96Iy4W94RHWsQ+IWWKslz9sf8O717UMkCpfUjyxNd7gPZADd1x/DwPIu3Mzf 0Et7wRAWRFsVWIUd82S5us0vP+0RqhQEhRJC4Or1rS3QCdasMOVE3rulR5cdDXKWw07w wiJv7URZJ+Ab788llU0qTnU16Rkr5IQdrANKYsOUbR+N9a7mLEs8enrysD88J2YXaK8Y gpJs2s0yq87ZRpFEIvB71r3ep7fmKxfJRdsuKkgb/o6NII8m1cWu1eTARinJU+xv7HgG h9kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=CAYh5I55TxVPxGV7n7tzTHnW6FKFtm6EPcJ1vvBtwD0=; fh=PyrCF+qsNaqndkAt6nzpU6jTKSl/iqI3Radtv0tyAIM=; b=GIIVnjGgiKgdWz+n3pJCk42+QWcydmvUziJHiJz98XcC7pTE7qOoHp/UhPM9o7pwYK QEkjSTQS9tBzF9fULj8EtyW5Jg9CgfYcBBfH79ZToDLncf8WhTYfQxwytLpUhxCGTRRO rBZFi2y5Tw9hYQO1ao44CKp3cPe1E6PJ8PdEkILwoi3jljmgCTCi26n/I9cFOYXENJ8P N4D6l0SO/PCRmb8A85J2ok92fffEQivQdJU7oARm+D8gNo4h+E5ECcGoQI7nPN8pCswk wdCWnqQ9HP8lgUPaVA7K0eMzBD8RIbAPXJa6a3UUfEvk5WSfmISkZ7HYDAv+Zt7uQCyz dlsg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776000905; x=1776605705; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CAYh5I55TxVPxGV7n7tzTHnW6FKFtm6EPcJ1vvBtwD0=; b=sIo3vtuuW2o2KsPTckgf1D9ebhhbJ58ph8UcP090ePoT1Q7STpZUselhCu10ZWz+TQ pRY9UvwvAqa8kQC5xQdcO13muBwF/yOUap/EN9qnzSXFoSycdBE/5oRNnWeS3j1tGedk Q0/xR7tVA9AfMCzdyPqACtR09WOfH4/UIlV6u+VMkqywuu2oxwu6BIHsdulEC6X8q4+W ckeSobAGpl3By0RyPPb0MtjkwWpkBylpVo3v/Mu61T3whBu4cweFkuMunxTJR7nciVYd FRpmCwgZCsdxrdSc0+qMVUK2kjyCHre9PjlcgwYL3ou+in4bXKxF/FOYGloSRrsUmCao vlHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776000905; x=1776605705; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CAYh5I55TxVPxGV7n7tzTHnW6FKFtm6EPcJ1vvBtwD0=; b=jj0c0QIj3oI6uS95rR1MCZn3cPRmxbc4gOMJcaTx8uYB8ybGwhMatTHmjmUHIQbTkh C7neU5e1sBh6dL5tKLl+do1zMbox5wP5cW1u0+zJMA6BmEZS/RBvnEliCaHIXZ3Z98Eb 9bT8HVBf0/4VJDcSmiWq+vzv8otEIgXB1znS9dh4UyF4uOb3ELDd/Mh93oukHsku0np/ kbERvndO/M9K2ubRp0h/tYXIVwwRJP2CIYTIQYv/QVT4CAb5nTEiHqpp9VQLkbC8Fd3V TsMmMZvIMLTGYCir/kJO7cOhuKLMc3LC/KjiWBCrAaZR+KdeMor1QgD8OP0bqacX53Ko MAZg== X-Gm-Message-State: AOJu0YyqdP0sZbsv7BLW8xpBLKS8vo2snqr/OaWGXVEGbhIL2536IMOf 1OlbDrnpY8vGeZV/6Sh58U4j3qfRcZG9NxXZFiMzayop/bKbhnTtWyGVOw1LbBNEzmYSeVz0Cgm 6b3ZK38p9Mah0uSI3bIlADYXhGtC7z1p3Gk83 X-Gm-Gg: AeBDieufEKXLlN7slfneqOOqBIR0nVsSdNhPHJb4al0txn/wBZFfp9DiVqGdTQgiF4e muV65MdUmhf4eQGp2tZnOrak+uJVwIN6XJ8zBBM7exg2/535XE2yTeADXz4EVvfSTR5QCMPKGzV MmVFUWYkYBbCfxLCjhQqgLJKzAVdjFeUFzuxOHJ8Xgnv5hDzhRKVhTEEI9HYfBwFyfXLCQwgXMA 6A5nonFIJzl0ce8oCOm47yWlj49MVoMA6+pVtQpefUrKruKmMlTk9eYH821cNAFkHf71c1eH3Yj hnph18FYm8ihl1iUgqDt3EGJ8V1x5nW0whAl0FF24HkaX0Q66L/4qCXfbOHkPmiCrEZxMVMBUg= = X-Received: by 2002:adf:ed03:0:b0:43d:7062:4367 with SMTP id ffacd0b85a97d-43d706243c8mr2974799f8f.25.1776000904978; Sun, 12 Apr 2026 06:35:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Mon, 13 Apr 2026 01:34:52 +1200 X-Gm-Features: AQROBzB6KIcttUXWLZVMhjdo1OwD0WeQuvZRrjBfnYQrj32K24Gynbq1x42q2-c Message-ID: Subject: Re: Use stack allocated StringInfoDatas, where possible (round 2) To: Bertrand Drouvot Cc: pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 12 Apr 2026 at 22:49, Bertrand Drouvot wrote: > Indeed, 5509055d6956 added a few cases that are using StringInfo but don't need > that StringInfo to exist beyond the scope of the function were using makeStringInfo(), > which allocates both a StringInfoData and the buffer it uses as two separate > allocations. It's more efficient for these cases to use a StringInfoData on the > stack and initialize it with initStringInfo(), which only allocates the string > buffer. I think the author of copy_sequences() doesn't know what resetStringInfo() does. I expect they think that it'll pfree all the memory, but that's what destroyStringInfo() is for. Since the strings are not used after the resetStringInfo(), the call is pointless. Could you ask Amit K to fix that first? Then rebase your patch atop. I think it makes sense to apply your patch as a StringInfo fixup post-freeze for v19 as leaving this for v20 will just result in the code not matching for no particularly good reason. David