PATCH: Add hooks for pg_total_relation_size and pg_indexes_size - Mailing list pgsql-hackers

From Abdoulaye Ba
Subject PATCH: Add hooks for pg_total_relation_size and pg_indexes_size
Date
Msg-id CA+-ifOaCGFcv0KuTwU-Y83a2kwL+CTG+7frx4khxJt3KQN+GUQ@mail.gmail.com
Whole thread Raw
Responses Re: PATCH: Add hooks for pg_total_relation_size and pg_indexes_size
Re: PATCH: Add hooks for pg_total_relation_size and pg_indexes_size
List pgsql-hackers
Hello PostgreSQL Hackers,

I am submitting a patch to add hooks for the functions pg_total_relation_size and pg_indexes_size. These hooks allow for custom behaviour to be injected into these functions, which can be useful for extensions and other custom PostgreSQL modifications.

Patch details: 
  • Adds pg_total_relation_size_hook and pg_indexes_size_hook 
  • Modifies pg_total_relation_size and pg_indexes_size to call these hooks if they are set 
  • Adds necessary type definitions and extern declarations
This feature is useful because it allows for more flexible and customizable behaviour in relation size calculations, which can be particularly valuable for extensions that need to account for additional storage outside of the standard PostgreSQL mechanisms.

The patch is attached. 

Thank you for considering this patch. I look forward to your feedback.

Kind regards,
Abdoulaye Ba
Attachment

pgsql-hackers by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Re: CREATE DATABASE with filesystem cloning
Next
From: Amit Kapila
Date:
Subject: Re: Found issues related with logical replication and 2PC