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 1vT6mp-00D6dZ-2a for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 23:06:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vT6mo-008AD6-1H for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 23:06:26 +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 1vT6mo-008ACx-0J for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 23:06:26 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vT6mm-0048RX-0l for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 23:06:26 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-297ef378069so58254765ad.3 for ; Tue, 09 Dec 2025 15:06:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765321582; x=1765926382; 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=aefE5qoWv6vbm3mdcpRVm0QhNcC/xJPQgo/cbvJ7B9M=; b=WImVOYj0urIXTZmuT97EyBo0WZ91pIYyEgmRD24Ncx6yZEzkpZ94LQjtJZOTBFpn+n KhyEottn0FQJR/rYQC9/SbUSAanwzMSFlMHNA6c4U+6iHi1uNr0f+78KhdeieiJMgzVX QtHGSqkJC3sxWarbQ3vhx7yR8DHlTOGUPsd+JMEDDSwS+3O5NygHQAgDCRwvEOEaOP2u mSJbu/hoJyeKCGBRrpgECAuMn6WJAFYQQ4MOAZ6M1l02/+PRHW67ti0703zPxddchhR6 JfM8Hg6ZpcAy6bSNUaY8KKvpJfVfYnHPe+IxxHmnfwwD8qwT9qTeNQpBvN2Ap69/BSM1 0JQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765321582; x=1765926382; 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=aefE5qoWv6vbm3mdcpRVm0QhNcC/xJPQgo/cbvJ7B9M=; b=vKLGRTRLF4chJrMJNdy2lrGRPC5681PSiBOrJK1NzCBaTE4HKiGHhlVGupBkT6y+Z+ bvFRhbssasbwD+qvOv7VlPahj9T9qkJ4IwpBqELFLlGB/zVLCDAnwVh8Fk1qrVqAKvj+ g9ZBq4gcJyzRLPwch/REVzCIFuvNpVkDuyVJpKV2AwBfbkAgabMYWMouBht1+QIWeJy1 9TcXKodw0yrsARCQyYlOqXN1SYyy5yfukhnaRAinhRwTyTayNbAXVxmGQ0aG9S2B7Ey2 UxohwF60Ph5YmrYMsRESM+YFkilF3vrtIdv+7FoVECxWjDNmY7IG8g0J8YG6jG2MBIpV ou1A== X-Forwarded-Encrypted: i=1; AJvYcCWxrwQdIuywbFzDOPur7O3sF1PO6H4WNariB+Fl8+9/vBv7CFRh8qkJWaJ3kczFnFU3jcMg6fcMkxD94Fk9@lists.postgresql.org X-Gm-Message-State: AOJu0YyxNpbSbMKhHKlV3ZEf3SDyCXScZo8PURrgbedXbhu3GJ5xWirA PfcAyg/i6JiGUjad9Th9CPO1KTsfnUaHUSLWazRFjwIkBH9nvkQUBlCQtaBNkrr19Ok= X-Gm-Gg: AY/fxX7UYvSfVKLi/iULFYiq4dIkQxMBAgNfvSSbBfu6pC8dNfvP9nN+9ZO16mJWh4O FPAJs2noSJ2dFu1GQyswGQfNkclK9+2xjXsGUzXIJ+AW1X2q4lYrSLUOI/GllctGWrxGyzN4THm YEn06N8A5RAL+Rtsxg/tpg8lxK9ZaN+oF/VZgKLcEQUuenfmPWEAufc0akr2O+19lhyu/lGBgUL ThHiqqnV8ucGXCwKBPJ4/eOaQ/G7dgUsqA831wDLiyGB4nkpVyk1EtN+2C75DLBOdVRFV6QM8r+ StG5uIhNT+z2U+1t+1jMk5+5pQM+ylmH5pZPuRdIJsC8D9V82Nyxqpd3wHg/ddxmWmz8LTDzzbk H07P1eAuxmBp2GTuyrSmgRV8y11Byg4s6Eouv41W2RfTldfRVeqSEfVhbDGXQ0jodcc4MtgUDbA 5XXZbWTO87BWLtKqFHqBE= X-Google-Smtp-Source: AGHT+IHeUfdCcxoAoz35dioCcCoZot39485+juEjBjd4EYRcRWDUs6u0/YDVlw6pF2N02GZ86un22w== X-Received: by 2002:a17:903:1965:b0:295:3584:1bbd with SMTP id d9443c01a7336-29ec26c3410mr3202285ad.41.1765321582200; Tue, 09 Dec 2025 15:06:22 -0800 (PST) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29dae4ee3e2sm161842125ad.43.2025.12.09.15.06.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Dec 2025 15:06:21 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [Proposal] Adding callback support for custom statistics kinds From: Chao Li In-Reply-To: Date: Wed, 10 Dec 2025 07:05:42 +0800 Cc: Michael Paquier , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <4E61FDC4-CFBB-4116-980F-75ADD245A1F6@gmail.com> References: <4FEEC2B8-D9CF-4BD0-AA7E-44CE3E27ADD8@gmail.com> <5EC13E39-B41E-464A-B382-0ACEB18A15BB@gmail.com> <9252DA7C-C611-4A93-A484-E6CD42557C15@gmail.com> To: Sami Imseih X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 10, 2025, at 05:54, Sami Imseih wrote: >=20 > IIUC, if *any* error occurs outside of a deserialize callback, first = the "error" > code will be called, followed by "done" which will then trigger the > end_extra_stats > callback that will perform the cleanup. That is true. But problem is, without an error indication, = end_extra_stats(STATS_READ) can only blindly perform cleanup works. As = you are providing general purposed callbacks, who knows what scenarios = extensions would do, so it=E2=80=99s better to provide more information = to callbacks. IMO, letting end_extra_stats() know current situation = (normal or failure, even error code) is very meaningful. For example, my = extension may want to log =E2=80=9CI am forced to quite due to outside = error=E2=80=9D or =E2=80=9CI am done successfully=E2=80=9D in = end_extra_stats(). Anyway, that=E2=80=99s my own opinion. If you and = Michael still consider that=E2=80=99s not a problem, I won=E2=80=99t = argue more. Best reagards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/