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 1wN2CA-000Wnz-39 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2026 05:31:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wN2C9-007a5c-2E for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2026 05:31:45 +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 1wN2C9-007a5S-1J for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2026 05:31:45 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wN2C6-00000000LeL-4A4Z for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2026 05:31:45 +0000 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-362e50b4641so3910901a91.0 for ; Tue, 12 May 2026 22:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778650302; x=1779255102; 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=lDXFT4Bbo7LrMgOYsLQ5cGlvaODcpsu4f5hl9NKhuZU=; b=Jv6FS4uPF7imCkn07leOUflN5+xtL+Qtk6CARmFGWVAvtf9IxKEF9e6G4ACmDH0wpj m/91z2sAUF43eTQRIxPkDkTlZpJHy6FuBlbRm0ks4gP+CMrh0dW7WqXeDG10yEu0dAoC jfKBleRfBypNyb3P+Br2C/8MrGOwEl2Vb9qWC/B5StAqyyla9H1A2AsdTogxwo6rYa9J tCfChvJzwcXfOkseAF/TayKf1G5HkrYryZ4Trvo4rvM1UPfUIa3IWNmnXxTyh90/CltG pqUkcwNBv3Ue5Cc/wRG9XqxQ5wQPeVgS82QgV6ENd6t7ks/6cg8S92tzCVLFK+5Tw4DO 00Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778650302; x=1779255102; 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=lDXFT4Bbo7LrMgOYsLQ5cGlvaODcpsu4f5hl9NKhuZU=; b=btVwYoxdwcYoDpkp1ThYziRyhxXIhlZvS2MJQx3WKTRUfzQy+ZuPSyyyNqF0qUnB3i 9LreEksM5uMpBQ+6MZ75nO11GDQumd7+hfIFLWp1794aRXUIeDWOgFEeXDWF7FIbfCke MMoW71uCyGTv2loMA9NovMnrYf5xb5bmiizZVUl1+r2vzTtyWE0Y3qeK0tRZp3yLcK6l 3lQEZqrvAKOWd1NWu9aGwTR1iVpDDQpKfoiysFsM2CaRxEebKbl4Ch4hS9xHFLlrI+Ap EddebaQP0RtDCCc10XrfeTtajHZlO6SCcJhvKGlRKMBZOFeQJ0AMZpQP3c7nzbb9fHV8 dIFQ== X-Forwarded-Encrypted: i=1; AFNElJ8O24g4j6VciqaDX7uaI0w1A29iMc00qZcVQ2pUaXSP+6rJiIMYxWuzTyss5jiIVGn6Le61KB38H7DmyYml@lists.postgresql.org X-Gm-Message-State: AOJu0YyHx+IyPeGAX1b8hfgXwSBbVZ/2ExcWPHlwYt+W+IOtFDWuTlT+ KSdNXecrFSYuzJRhFh7uDJauQcsqljltbb2EQewZ359zWY/d4ZZ8QAT3VGTnHQZ6 X-Gm-Gg: Acq92OHjaJlarxNARja8kcM1Nvnnrjg8L4HbE4Ommde4xK/6qkPXTux5ELGVDPMzZBN 9NlHw34GjMysk9JaOrXeJSHIgaFhp0ImA0eZurWrEht9ixDdBmG0pDCA6HQwhoSfV+mZ7hTuS1n v1BaYXilWdO+uHciPHuwW0ZcoYy20NchAnJoBHGzY3hyFHiAoPwVDAUPqS4DVODJnjDC5vS4s57 OixcDLxOB/rZA46UBxsJDykcnxPAcalzf/8FZVSGhc92iK4LXTtBi6A2a9PTiiQAME0kjNEHfBQ 45XbZ/MuaQO2dxpRKoo3MRxTnQqgQ7OynNViadr8waxt0bYiTWnH3/8p6qbG67mR0IELdXFkKD4 NX+1r84VS/p8is9VpH4m2z8ebH5s1BLVA0MJkpyDAATMv/zrDDFd+xiKXNC7VgLF3UJNVi4sOv9 4yuSB/EljB3ABl2GX1VSOGaEVX74+POgA= X-Received: by 2002:a17:90a:ec88:b0:367:bae8:a74f with SMTP id 98e67ed59e1d1-368f398c9ebmr2175571a91.6.1778650301507; Tue, 12 May 2026 22:31:41 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-368ac4c3acasm2675096a91.0.2026.05.12.22.31.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2026 22:31:40 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: Fix unsafe PlannedStmt access in pg_stat_statements From: Chao Li In-Reply-To: Date: Wed, 13 May 2026 13:31:01 +0800 Cc: Andres Freund , pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <2F91906A-F2B5-4A6B-9695-D136957D4545@gmail.com> <0A9A8DAC-BC3C-4C7A-9504-2C6050405544@anarazel.de> To: Michael Paquier 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 May 13, 2026, at 12:26, Michael Paquier = wrote: >=20 > On Tue, May 12, 2026 at 11:00:16AM +0200, Andres Freund wrote: >> Seems like the code should make this clearer, by simply unsetting >> pstmt at the point it becomes unsafe to use? >=20 > Sure, we could do that as well and crash hard if something decides to > do the same mistake. Like the simple patch attached for example? I > am not sure if we need to update the comment. It's pretty clear what > the intention is, at least to me. > -- > Michael > Yeah, this is the exactly same change I was about to reply. And I agree = the current comment is clear enough, no more needed to add. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/