Hi,

On Fri, Dec 19, 2025 at 02:21:40PM +0800, Japin Li wrote:
> On Fri, 19 Dec 2025 at 04:29, Bertrand Drouvot <[email protected]> 
> wrote:
> > Yeah, and removing IS_INDEX() and adding a check for partitioned indexes 
> > would
> > still mean 2 code paths. So, v2 changes the close calls (and that's 
> > consistent
> > with what pgstatginindex_internal() is doing.
> >
> 
> It would be reasonable to add a comment explaining the choice of
> relation_open()/relation_close() instead of the index-specific
> index_open()/index_close().

Yeah that would not hurt. What about before the relation_open() calls?

"
Use relation_open() and not index_open() to avoid the validate_relation_kind()
check as we handle relation validation separately below.
"

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com


Reply via email to