Hi,I've pushed both of these patches, with some minor tweaks (freeing the statistics list, and deleting the new context), and backpatched them all the way to 10.
Thanks for the report & patch, Justin! regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company