Re: pgstat: add pgstat_prep_pending() for entry ref pending setup - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: pgstat: add pgstat_prep_pending() for entry ref pending setup
Date
Msg-id CAA5RZ0um+tnU9iFWeRun1BKSnKhihQpd=zD03+6O1TtMMGcwzQ@mail.gmail.com
Whole thread
In response to Re: pgstat: add pgstat_prep_pending() for entry ref pending setup  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pgstat: add pgstat_prep_pending() for entry ref pending setup
List pgsql-hackers
> On Thu, Jul 16, 2026 at 01:04:38PM +0900, Kyotaro Horiguchi wrote:
> > One concern I have is the name of the new function.
> > pgstat_prep_pending() sounds a bit incomplete. Would a name such as
> > pgstat_prep_pending_for_entry_ref() be clearer?
>
> Hmm.  pgstat_prep_pending_for_entry_ref() would work here for the
> name.

I think pgstat_prep_pending_from_entry_ref() is better that _for_.


> Regarding the new function's comment, perhaps it could be phrased
> similarly to that of pgstat_prep_pending_entry(), for example:

> > Prepare the given entry to receive pending stats, if not already done.

This simple comment is sufficient. fixed.

> Finally, pgstat_get_entry_ref() does not return NULL when create is
> true, but the new function itself does not enforce that assumption. It
> might be worth adding an Assert(entry_ref != NULL), in addition to the
> assertion on flush_pending_cb.

Done.

See the attached.

--
Sami Imseih
Amazon Web Services (AWS)

Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Fix publisher-side sequence permission reporting
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: PG20 Minimum Dependency Thread