On 2019-Nov-13, Tom Lane wrote: > (BTW, a different question one could ask is exactly why > RelationBuildPartitionDesc is so profligate of leaked memory.)
The original partitioning code (f0e44751d717) decided that it didn't want to bother with adding a "free" routine for PartitionBoundInfo structs, maybe because it had too many pointers, so there's no way for RelationBuildPartitionDesc to free everything it allocates anyway. We could add a couple of pfrees and list_frees here and there, but for the main thing being leaked we'd need to improve that API. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services