Re: Add counted_by attribute - Mailing list pgsql-hackers

From Tristan Partin
Subject Re: Add counted_by attribute
Date
Msg-id DLY1OPBXGI77.UTU2G1WQ0IN1@partin.io
Whole thread
In response to Re: Add counted_by attribute  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
On Mon Oct 5, 2026 at 7:52 PM UTC, Peter Eisentraut wrote:
> Ok, all the infrastructure is in place now.  I'm working through the
> attribute additions now.
>
> One thing to think about is that adding these attributes to server
> header files would also affect extensions.  I think we might want to do
> some research about that.  Like, is the normal API to fill in the
> structure yourself, or are there wrapper functions that are mandatory to
> use?  I'm going to park that for the moment and work through the
> attribute additions in .c files first.

I have to think that extensions testing with
-fsanitize=bounds/_FORTIFY_SOURCE=3 is pretty rare. In any case, I did
some analysis (grepping and reading) on the list of structs exposed in
header files against 9 popular extensions (not in contrib), and I didn't
find any potential issues.

List of extensions that I looked at:
- PostGIS
- Citus
- TimescaleDB
- pgvector
- pg_cron
- pg_hint_plan
- pgaudit
- pg_repack
- pglogical

It seems like core does a good job of providing helper functions/macros
for creating objects of variable size, and downstream extensions do
a good job of making use of them.

If you have ideas that you would like me to try to help make you more
confident in committing, let me know.

Attached is a list of structs, in header files, that I added the
counted_by attribute to.

--
Tristan Partin
PostgreSQL Contributors Team
AWS (https://aws.amazon.com)

Attachment

pgsql-hackers by date:

Previous
From: "Matheus Alcantara"
Date:
Subject: Re: PG19: two RI fast-path issues found while testing the batching revert
Next
From: Zsolt Parragi
Date:
Subject: Re: Incremental backups report progress as if they were full backups