pgsql: Remove pg_regex_collation

2024-12-04 Thread Peter Eisentraut
Remove pg_regex_collation We can also use the existing pg_regex_locale as the cache key, which is the only use of this variable. Reviewed-by: Jeff Davis Discussion: https://www.postgresql.org/message-id/flat/b1b92ae1-2e06-4619-a87a-4b4858e547ec%40eisentraut.org Branch -- master Details --

pgsql: Fix header inclusion order in c.h.

2024-12-04 Thread Thomas Munro
Fix header inclusion order in c.h. Commit 962da900a added #include to postgres_ext.h, which broke c.h's header ordering rule. The system headers on some systems would then lock down off_t's size in private macros, before they'd had a chance to see our definition of _FILE_OFFSET_BITS (and presuma

pgsql: Provide a better error message for misplaced dispatch options.

2024-12-04 Thread Nathan Bossart
Provide a better error message for misplaced dispatch options. Before this patch, misplacing a special must-be-first option for dispatching to a subprogram (e.g., postgres -D . --single) would fail with an error like FATAL: --single requires a value This patch adjusts this error to more

pgsql: Return actual error code from FOP failure in PDF build

2024-12-04 Thread Bruce Momjian
Return actual error code from FOP failure in PDF build Previously we returned "1" on error. Improvement on 77c189cdafe. Backpatch-through: master Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/24c1c6338719e4de1dd5f045418e64957781c595 Modified Files -

pgsql: Fix dead code

2024-12-04 Thread Peter Eisentraut
Fix dead code from commit 85b7efa1cdd per Coverity report Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/dfbb092cff70ee4d4084b7e4e57228a89ff4f9f8 Modified Files -- src/backend/utils/adt/like_match.c | 7 --- 1 file changed, 4 insertions(+), 3 delet

Re: pgsql: Introduce CompactAttribute array in TupleDesc

2024-12-04 Thread David Rowley
On Tue, 3 Dec 2024 at 17:55, Tom Lane wrote: > Just a gut-level guess, but I'm wondering about something like > uninitialized fields that happen to work as long as the memory > was zero to start with. A run under valgrind might offer insight. Thanks. I've written about the cause of this in [1].

pgsql: Fix use-after-free in parallel_vacuum_reset_dead_items

2024-12-04 Thread John Naylor
Fix use-after-free in parallel_vacuum_reset_dead_items parallel_vacuum_reset_dead_items used a local variable to hold a pointer from the passed vacrel, purely as a shorthand. This pointer was later freed and a new allocation was made and stored to the struct. Then the local pointer was mistakenly

pgsql: Fix use-after-free in parallel_vacuum_reset_dead_items

2024-12-04 Thread John Naylor
Fix use-after-free in parallel_vacuum_reset_dead_items parallel_vacuum_reset_dead_items used a local variable to hold a pointer from the passed vacrel, purely as a shorthand. This pointer was later freed and a new allocation was made and stored to the struct. Then the local pointer was mistakenly