Fix PGresult leak in pg_dump during binary upgrade
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-05-15T18:40:43Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-query-result-leak-during-binary-upgrade.patch (application/octet-stream) patch 0001
While looking at pg_dump performance today I noticed that pg_dump fails to clear query results in binary_upgrade_set_pg_class_oids during binary upgrade mode. 9a974cbcba00 moved the query to the outer block, but left the PQclear and query buffer destruction in the is_index conditional, making it not always be executed. 353708e1fb2d fixed the leak of the query buffer but left the PGresult leak. The attached fixes the PGresult leak which when upgrading large schemas can be non-trivial. This needs to be backpatched down to v15. -- Daniel Gustafsson
Commits
-
Fix query result leak during binary upgrade
- e6fc3b70df90 15.8 landed
- a8f87d5d21c2 17.0 landed
- 0ae05c18e0bf 16.4 landed