pgsql: Fix memory leak in pgoutput with relation attribute map

2024-12-29 Thread Michael Paquier
Fix memory leak in pgoutput with relation attribute map pgoutput caches the attribute map of a relation, that is free()'d only when validating a RelationSyncEntry. However, this code path is not taken when calling any of the SQL functions able to do some logical decoding, like pg_logical_slot_{ge

pgsql: Fix memory leak in pgoutput with relation attribute map

2024-12-29 Thread Michael Paquier
Fix memory leak in pgoutput with relation attribute map pgoutput caches the attribute map of a relation, that is free()'d only when validating a RelationSyncEntry. However, this code path is not taken when calling any of the SQL functions able to do some logical decoding, like pg_logical_slot_{ge

pgsql: Fix memory leak in pgoutput with relation attribute map

2024-12-29 Thread Michael Paquier
Fix memory leak in pgoutput with relation attribute map pgoutput caches the attribute map of a relation, that is free()'d only when validating a RelationSyncEntry. However, this code path is not taken when calling any of the SQL functions able to do some logical decoding, like pg_logical_slot_{ge

pgsql: Fix memory leak in pgoutput with relation attribute map

2024-12-29 Thread Michael Paquier
Fix memory leak in pgoutput with relation attribute map pgoutput caches the attribute map of a relation, that is free()'d only when validating a RelationSyncEntry. However, this code path is not taken when calling any of the SQL functions able to do some logical decoding, like pg_logical_slot_{ge

pgsql: Remove redundant wording in pg_statistic.h

2024-12-29 Thread Michael Paquier
Remove redundant wording in pg_statistic.h Author: Junwang Zhao Discussion: https://postgr.es/m/CAEG8a3JbMCHna=n5zsx6hulntdfw34kw7pf2n8+3m-9urrw...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ebf2ab40e5e1b0545257e8b27a1d48e9488c23f4 Modified Fil

pgsql: Fix failures with incorrect epoch handling for 2PC files at reco

2024-12-29 Thread Michael Paquier
Fix failures with incorrect epoch handling for 2PC files at recovery At the beginning of recovery, an orphaned two-phase file in an epoch different than the one defined in the checkpoint record could not be removed based on the assumptions that AdjustToFullTransactionId() relies on, assuming that

pgsql: Fix failures with incorrect epoch handling for 2PC files at reco

2024-12-29 Thread Michael Paquier
Fix failures with incorrect epoch handling for 2PC files at recovery At the beginning of recovery, an orphaned two-phase file in an epoch different than the one defined in the checkpoint record could not be removed based on the assumptions that AdjustToFullTransactionId() relies on, assuming that

pgsql: Fix handling of orphaned 2PC files in the future at recovery

2024-12-29 Thread Michael Paquier
Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if

pgsql: Fix handling of orphaned 2PC files in the future at recovery

2024-12-29 Thread Michael Paquier
Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if

pgsql: Fix handling of orphaned 2PC files in the future at recovery

2024-12-29 Thread Michael Paquier
Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if

pgsql: Fix handling of orphaned 2PC files in the future at recovery

2024-12-29 Thread Michael Paquier
Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if

pgsql: Fix handling of orphaned 2PC files in the future at recovery

2024-12-29 Thread Michael Paquier
Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if

pgsql: Fix handling of orphaned 2PC files in the future at recovery

2024-12-29 Thread Michael Paquier
Fix handling of orphaned 2PC files in the future at recovery Before 728bd991c3c4, that has improved the support for 2PC files during recovery, the initial logic scanning files in pg_twophase was done so as files in the future of the transaction ID horizon were checked first, followed by a check if

pgsql: contrib/pageinspect: Use SQL-standard function bodies.

2024-12-29 Thread Tom Lane
contrib/pageinspect: Use SQL-standard function bodies. In the same spirit as 969bbd0fa, 13e3796c9, 3f323eba8. Tom Lane and Ronan Dunklau Discussion: https://postgr.es/m/3316564.aeNJFYEL58@aivenlaptop Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/68ff25eef125a5ea

pgsql: contrib/xml2: Use SQL-standard function bodies.

2024-12-29 Thread Tom Lane
contrib/xml2: Use SQL-standard function bodies. In the same spirit as 969bbd0fa, 13e3796c9, 3f323eba8. Tom Lane and Ronan Dunklau Discussion: https://postgr.es/m/3316564.aeNJFYEL58@aivenlaptop Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/667368fd26de5846d6f6b8a

pgsql: contrib/citext: Use SQL-standard function bodies.

2024-12-29 Thread Tom Lane
contrib/citext: Use SQL-standard function bodies. In the same spirit as 969bbd0fa, 13e3796c9, 3f323eba8. Tom Lane and Ronan Dunklau Discussion: https://postgr.es/m/3316564.aeNJFYEL58@aivenlaptop Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/97a5a16849eb4642e38d9

Re: pgsql: Replace BackendIds with 0-based ProcNumbers

2024-12-29 Thread Peter Eisentraut
On 03.03.24 18:39, Heikki Linnakangas wrote: Replace BackendIds with 0-based ProcNumbers There are a couple of declarations that are duplicated between src/include/storage/proc.h and src/include/storage/procnumber.h, such as MyProcNumber, ParallelLeaderProcNumber, and ProcNumberForTempRelati

pgsql: Fix overly large values/nulls arrays

2024-12-29 Thread David Rowley
Fix overly large values/nulls arrays These arrays were sized with Natts_pg_trigger (19) when they should have been sized with Natts_pg_event_trigger (7). We'd better fix this as it's clearly a mistake and it could become problematic if pg_event_trigger were to gain a dozen or so more columns in t