Re: [Proposal] Adding callback support for custom statistics kinds - Mailing list pgsql-hackers

From Chao Li
Subject Re: [Proposal] Adding callback support for custom statistics kinds
Date
Msg-id 4E61FDC4-CFBB-4116-980F-75ADD245A1F6@gmail.com
Whole thread Raw
In response to Re: [Proposal] Adding callback support for custom statistics kinds  (Sami Imseih <samimseih@gmail.com>)
Responses Re: [Proposal] Adding callback support for custom statistics kinds
List pgsql-hackers

> On Dec 10, 2025, at 05:54, Sami Imseih <samimseih@gmail.com> wrote:
>
> 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’s better to
providemore information to callbacks. IMO, letting end_extra_stats() know current situation (normal or failure, even
errorcode) is very meaningful. For example, my extension may want to log “I am forced to quite due to outside error” or
“Iam done successfully” in end_extra_stats(). Anyway, that’s my own opinion. If you and Michael still consider that’s
nota problem, I won’t argue more. 

Best reagards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Fix incorrect comments in tuplesort.c
Next
From: Heikki Linnakangas
Date:
Subject: Re: Fix a minor typo in the comment of read_stream_start_pending