Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-04-06 Thread Michael Paquier
On Sun, Apr 06, 2025 at 09:18:45AM -0700, Jeff Davis wrote: > My mistake, backported through 16 now. Thanks! -- Michael signature.asc Description: PGP signature

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-04-06 Thread Jeff Davis
On Sat, 2025-04-05 at 17:24 +0900, Michael Paquier wrote: > I am back to a laptop, and just noticed that you have applied > f4e51eab4eb0 into the tree to take care of this issue, affecting only > HEAD.  Why didn't you do a backpatch of this commit down to v16? > That's down to where 2a083ab807db ha

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-04-05 Thread Michael Paquier
On Sun, Mar 30, 2025 at 11:12:20AM -0700, Jeff Davis wrote: > Why pg_strdup() the "NULL" at all in that case? Usually I see that done > so that there doesn't need to be a conditional when freeing, but here > there's a conditional anyway. > > Perhaps something like the attached? I am back to a lap

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-04-01 Thread Michael Paquier
On Mar 31, 2025, at 3:12, Jeff Davis wrote: > Why pg_strdup() the "NULL" at all in that case? Usually I see that done > so that there doesn't need to be a conditional when freeing, but here > there's a conditional anyway. > > Perhaps something like the attached? This would work for me as well. I

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-03-30 Thread Jeff Davis
On Sun, 2025-03-30 at 07:03 +0900, Michael Paquier wrote: > Thanks for the report.  It would be possible to switch to a second > approach here, where we use pg_free() if we don't have a > locale->db_locale to make sure that the memory is freed in its > correct > context, like in the attached.  What

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-03-29 Thread Michael Paquier
On Sat, Mar 29, 2025 at 09:24:58AM -0700, Jeff Davis wrote: > This seems to have broken the pg_upgrade test when olddump/oldinstall > are set to PG14 or earlier: > > stderr: > # Failed test 'check that locales in new cluster match original > cluster' > # at > /home/jdavis/git/postgresql/src/bi

Re: pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-03-29 Thread Jeff Davis
On Fri, 2025-02-28 at 01:16 +, Michael Paquier wrote: > pg_upgrade: Fix inconsistency in memory freeing > Details > --- > https://git.postgresql.org/pg/commitdiff/2a083ab807db6d9e2e0e3aa82ee8f6ff9fc44c8d > This seems to have broken the pg_upgrade test when olddump/oldinstall are set to P

pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-02-28 Thread Michael Paquier
pg_upgrade: Fix inconsistency in memory freeing The function in charge of freeing the memory from a result created by PQescapeIdentifier() has to be PQfreemem(), to ensure that both allocation and free come from libpq. One spot in pg_upgrade was not respecting that for pg_database's datlocale (da

pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-02-27 Thread Michael Paquier
pg_upgrade: Fix inconsistency in memory freeing The function in charge of freeing the memory from a result created by PQescapeIdentifier() has to be PQfreemem(), to ensure that both allocation and free come from libpq. One spot in pg_upgrade was not respecting that for pg_database's datlocale (da

pgsql: pg_upgrade: Fix inconsistency in memory freeing

2025-02-27 Thread Michael Paquier
pg_upgrade: Fix inconsistency in memory freeing The function in charge of freeing the memory from a result created by PQescapeIdentifier() has to be PQfreemem(), to ensure that both allocation and free come from libpq. One spot in pg_upgrade was not respecting that for pg_database's datlocale (da