>
> Note an extra edge case in pgstat_init_function_usage(), which should do
> the same, I guess?
>
I noticed it but wasn't sure if it was necessary here due to the exceptional case here.
It raises ereport error right after and can only reach this if the entry was created
In the call to pgstat_prep_pending_entry before it, so it seems unlikely another
backend holds a ref to it. I might be wrong though.
> Attached is an updated patch with refined comments at the top of ?
> pgstat_drop_entry(), to be applied to 15~.
Thanks for testing the patch. Updated patch looks good to me.
-Floris