Re: Fix PGresult leak in pg_dump during binary upgrade

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix PGresult leak in pg_dump during binary upgrade
Date: 2024-05-15 18:46:31
Message-ID: 1810545.1715798791@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
> 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.

+1 --- in 353708e1f I was just fixing what Coverity complained about.
I wonder why it missed this; it does seem to understand that PGresult
leaks are a thing. But anyway, I missed it too.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

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