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)
header,struct,array_member,count_field access/brin_internal.h,BrinOpcInfo,oi_typcache,oi_nstored access/tupdesc.h,TupleDescData,compact_attrs,natts executor/execPartition.h,PartitionPruneState,partprunedata,num_partprunedata executor/execPartition.h,PartitionPruningData,partrelprunedata,num_partrelprunedata executor/instrument.h,WorkerNodeInstrumentation,instrument,num_workers executor/instrument_node.h,SharedAggInfo,sinstrument,num_workers executor/instrument_node.h,SharedBitmapHeapInstrumentation,sinstrument,num_workers executor/instrument_node.h,SharedHashInfo,hinstrument,num_workers executor/instrument_node.h,SharedIncrementalSortInfo,sinfo,num_workers executor/instrument_node.h,SharedIndexScanInstrumentation,winstrument,num_workers executor/instrument_node.h,SharedMemoizeInfo,sinstrument,num_workers executor/instrument_node.h,SharedSeqScanInstrumentation,sinstrument,num_workers executor/instrument_node.h,SharedSortInfo,sinstrument,num_workers executor/instrument_node.h,SharedTidRangeScanInstrumentation,sinstrument,num_workers fe_utils/parallel_slot.h,ParallelSlotArray,slots,numslots jit/jit.h,SharedJitInstrumentation,jit_instr,num_workers nodes/bitmapset.h,Bitmapset,words,nwords regex/regguts.h,struct arcbatch,a,narcs regex/regguts.h,struct statebatch,s,nstates statistics/extended_stats_internal.h,MultiSortSupportData,ssup,ndims statistics/statistics.h,MCVList,items,nitems statistics/statistics.h,MVDependencies,deps,ndeps statistics/statistics.h,MVDependency,attributes,nattributes statistics/statistics.h,MVNDistinct,items,nitems tsearch/dicts/spell.h,SPNode,data,length utils/catcache.h,CatCList,members,n_members utils/datetime.h,TimeZoneAbbrevTable,abbrevs,numabbrevs
