Fix PGresult leak in pg_dump during binary upgrade

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Fix PGresult leak in pg_dump during binary upgrade
Date: 2024-05-15 18:40:43
Message-ID: 374550C1-F4ED-4D9D-9498-0FD029CCF674@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-Fix-query-result-leak-during-binary-upgrade.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-05-15 18:46:10 Re: add function argument names to regex* functions.
Previous Message Tom Lane 2024-05-15 18:39:47 Re: [PATCH] Add --syntax to postgres for SQL syntax checking