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 1wf9ZS-005IZ7-2E for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2026 05:02:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wf9ZR-0000Q2-26 for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2026 05:02:41 +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 1wf9ZR-0000Pu-1B for pgsql-hackers@lists.postgresql.org; Thu, 02 Jul 2026 05:02:41 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wf9ZP-00000001Bbq-0pr6 for pgsql-hackers@lists.postgresql.org; Thu, 02 Jul 2026 05:02:40 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-493c19bad03so10386435e9.2 for ; Wed, 01 Jul 2026 22:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782968558; x=1783573358; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=WkYP3cKgoqBiKhB220ZYWxux9YmQMjr8AHosZnZ5upk=; b=c1Je50t8h8ZLBPzJud+SFEnbzuFDrXw5fnOpTfBi1BfxUDQapTfGnbPm4ZcKUSULk0 FPsbC1OedxhgSVaBILJmmEJaFnKQUiv3a4rkKt73zlCesqiRtQKqkcKJjuzSLr1lT3D3 QVQy75/YJInwQB/rPjywBZ8SzU+cQUvAVSeBPmOjnr/8J5zqo2Ugye4E9zogXVPhuUC7 EaL7fCs4P3pZOFCJnNzSSQCIrAHcspUHjSwAOUHei/+rou+o237T+IKAKd7e89VSlH7x Nvv0dUSlYAySgYMv2y2GmiStOrm8qL+J6W8nUhvs1ZlfgkqF8oWYsTOiwGI3UvRQuXSp BySA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782968558; x=1783573358; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WkYP3cKgoqBiKhB220ZYWxux9YmQMjr8AHosZnZ5upk=; b=e8aTP95OMQcpJXYG4ugNSVk09NQ46wTENEHgFuS+eFj9RyiyYxxcTe61jPXZzrPscR Y+QJkcjZSj7Bb3jA+vm5FNIOJ9s7Bh50362YTZTqI6tuVpYSYfRCEH9HROC+WwKt3+bs HhMhKrtA3AzJKVNWOD1ndoS6A+lOpkdigGNuilEue4RMojvlPgIlBCD09sz4GesDoqPF wbEC+MowgdghXe2tBeQ4YA/obLbRbhRr6zpvB/dRJ/9Qq3NpZ+TdFTZl2HYfVhyLZIpe EVnjgsNnrCPOp0558iKdfzkCRxKLE/6bte90XKnWUGA7wG5gXtfdxWHbEsWKi2RlFdga ihKw== X-Forwarded-Encrypted: i=1; AFNElJ8bJrlxqnPrk5JbQbT3eWvVyyV0d236PhXNQdeOp6LOlzcD5cQVxmNeY64R2pXLKpOKXUrKBX1/GEWGTi/J@lists.postgresql.org X-Gm-Message-State: AOJu0YxomdxPeLy4pG63Wa3PVgpcxzFpM6pGjsCPa0v/kgAAP6+JSg1D F2EYolsIc+n8nu94DdU6mQeHgNgmlsrZOUcY2y3mFEbyP7pFwnXU1TCw X-Gm-Gg: AfdE7ck5BOGvzN6BzeMdlpkimSeAf3hB3EjLRN6lx4ppajGf8LEbGuXrRTR8neoptIk MrQrYk9EEyJeSq12OfWzSuTSoQHcbkPz8SA+HBMfhmUEi3OZ8VyjIX2Bvv4O+XVqsDlQCCu4Au7 tfSBHHB5g9Rtiqs6aKdPlOfXabOh0jwW6gbXoc88mHBesn65QgXvPxfQ4eFPhMpX6g/6cNRv/4r OrEIS9iSWvtsvnbFqxf27sE2foMzH06ch3iWSeqztQOII6yJu8ObmN7iWYsAqi1XQdF6Bc5L9Ts 1Ez3uRRuRS8fgpoi5Ffp8y78B8LskxeDTZa65VKdClFrW8xzooHm6BesEMbweDBXtc+KgCk4lhG ASgEfafJ+NZAqYperbpcFz2xlLvMxZTDArCuXBf6ltrkreBTXM5AI2jAQNHvmhmPpNiidoeEhAe 2n0JRr4W8zqohzuUp58VPpLf9rqjn88FUFV5zIGwmNq0Fz/lPOHFdtBNLiPyqMjysDB/q0VSKS X-Received: by 2002:a05:600c:34d4:b0:493:b8cf:cc8a with SMTP id 5b1f17b1804b1-493c2b3ccd2mr55230145e9.4.1782968557598; Wed, 01 Jul 2026 22:02:37 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493c6354771sm17099615e9.3.2026.07.01.22.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2026 22:02:37 -0700 (PDT) Date: Thu, 2 Jul 2026 05:02:36 +0000 From: Bertrand Drouvot To: Michael Paquier Cc: Ewan Young , pgsql-hackers@lists.postgresql.org Subject: Re: Prevent crash when calling pgstat functions with unregistered stats kind Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Thu, Jul 02, 2026 at 02:00:06PM +0900, Michael Paquier wrote: > On Thu, Jul 02, 2026 at 04:43:32AM +0000, Bertrand Drouvot wrote: > > On Thu, Jul 02, 2026 at 04:23:16AM +0000, Bertrand Drouvot wrote: > >> Ok but what about extensions that don't call pgstat_register_kind() at all? Your > >> point is that they would see the issue during the development of the extension? (If > >> so, I think I could agree). > > Extensions doing custom stats have to call the register API, or > they're broken. This is the same assumption as custom RMGRs. There > are many ways to break the backend if you don't know what you do, just > take hooks for example. That's just one of them. > > > Something like in the attached? > > Yes, that looks OK here. That makes sense, I do agree. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com