pgsql: Skip SectionMemoryManager.h in cpluspluscheck.

2024-11-27 Thread Thomas Munro
Skip SectionMemoryManager.h in cpluspluscheck. Commit 9044fc1d45a0 skipped SectionMemoryManager.h in headerscheck, and by extension also cpluspluscheck, because it's C++ and would fail both tests. That worked in master and REL_17_STABLE due to 7b8e2ae2fd3b, but older branches have a separate cplu

pgsql: Skip SectionMemoryManager.h in cpluspluscheck.

2024-11-27 Thread Thomas Munro
Skip SectionMemoryManager.h in cpluspluscheck. Commit 9044fc1d45a0 skipped SectionMemoryManager.h in headerscheck, and by extension also cpluspluscheck, because it's C++ and would fail both tests. That worked in master and REL_17_STABLE due to 7b8e2ae2fd3b, but older branches have a separate cplu

pgsql: Skip SectionMemoryManager.h in cpluspluscheck.

2024-11-27 Thread Thomas Munro
Skip SectionMemoryManager.h in cpluspluscheck. Commit 9044fc1d45a0 skipped SectionMemoryManager.h in headerscheck, and by extension also cpluspluscheck, because it's C++ and would fail both tests. That worked in master and REL_17_STABLE due to 7b8e2ae2fd3b, but older branches have a separate cplu

pgsql: Skip SectionMemoryManager.h in cpluspluscheck.

2024-11-27 Thread Thomas Munro
Skip SectionMemoryManager.h in cpluspluscheck. Commit 9044fc1d45a0 skipped SectionMemoryManager.h in headerscheck, and by extension also cpluspluscheck, because it's C++ and would fail both tests. That worked in master and REL_17_STABLE due to 7b8e2ae2fd3b, but older branches have a separate cplu

pgsql: Use __attribute__((target(...))) for SSE4.2 CRC-32C support.

2024-11-27 Thread Nathan Bossart
Use __attribute__((target(...))) for SSE4.2 CRC-32C support. Presently, we check for compiler support for the required intrinsics both with and without the -msse4.2 compiler flag, and then depending on the results of those checks, we pick which files to compile with which flags. This is tedious a

pgsql: ci: Fix cached MacPorts installation management

2024-11-27 Thread Andres Freund
ci: Fix cached MacPorts installation management 1. The error reporting of "port setrequested list-of-packages..." changed, hiding errors we were relying on to know if all packages in our list were already installed. Use a loop instead. 2. The cached MacPorts installation was shared between Pos

pgsql: ci: Fix cached MacPorts installation management

2024-11-27 Thread Andres Freund
ci: Fix cached MacPorts installation management 1. The error reporting of "port setrequested list-of-packages..." changed, hiding errors we were relying on to know if all packages in our list were already installed. Use a loop instead. 2. The cached MacPorts installation was shared between Pos

pgsql: ci: Fix cached MacPorts installation management

2024-11-27 Thread Andres Freund
ci: Fix cached MacPorts installation management 1. The error reporting of "port setrequested list-of-packages..." changed, hiding errors we were relying on to know if all packages in our list were already installed. Use a loop instead. 2. The cached MacPorts installation was shared between Pos

pgsql: ecpg: put all string-valued tokens returned by pgc.l in local st

2024-11-27 Thread Tom Lane
ecpg: put all string-valued tokens returned by pgc.l in local storage. This didn't work earlier in the patch series (I think some of the strings were ending up in data-type-related structures), but apparently we're now clean enough for it. This considerably reduces process-lifespan memory leakage

pgsql: ecpg: fix some memory leakage of data-type-related structures.

2024-11-27 Thread Tom Lane
ecpg: fix some memory leakage of data-type-related structures. ECPGfree_type() and related functions were quite incomplete about removing subsidiary data structures. Possibly this is because ecpg wasn't careful to make sure said data structures always had their own storage. Previous patches in t

pgsql: file_fdw: Add regression tests for ON_ERROR and other options.

2024-11-27 Thread Fujii Masao
file_fdw: Add regression tests for ON_ERROR and other options. This commit introduces regression tests to validate incorrect settings for the ON_ERROR, LOG_VERBOSITY, and REJECT_LIMIT options in file_fdw. Author: Atsushi Torikoshi Reviewed-by: Fujii Masao Suggested-by: Yugo Nagata Discussion: ht

pgsql: jsonapi: add lexer option to keep token ownership

2024-11-27 Thread Andrew Dunstan
jsonapi: add lexer option to keep token ownership Commit 0785d1b8b adds support for libpq as a JSON client, but allocations for string tokens can still be leaked during parsing failures. This is tricky to fix for the object_field semantic callbacks: the field name must remain valid until the end o

pgsql: pgbench: Ensure previous progress message is fully cleared when

2024-11-27 Thread Fujii Masao
pgbench: Ensure previous progress message is fully cleared when updating. During pgbench's table initialization, progress updates could display leftover characters from the previous message if the new message was shorter. This commit resolves the issue by appending spaces to the current message to

pgsql: pgbench: Ensure previous progress message is fully cleared when

2024-11-27 Thread Fujii Masao
pgbench: Ensure previous progress message is fully cleared when updating. During pgbench's table initialization, progress updates could display leftover characters from the previous message if the new message was shorter. This commit resolves the issue by appending spaces to the current message to

pgsql: pgbench: Ensure previous progress message is fully cleared when

2024-11-27 Thread Fujii Masao
pgbench: Ensure previous progress message is fully cleared when updating. During pgbench's table initialization, progress updates could display leftover characters from the previous message if the new message was shorter. This commit resolves the issue by appending spaces to the current message to

pgsql: ci: Fix cached MacPorts installation management

2024-11-27 Thread Andres Freund
ci: Fix cached MacPorts installation management 1. The error reporting of "port setrequested list-of-packages..." changed, hiding errors we were relying on to know if all packages in our list were already installed. Use a loop instead. 2. The cached MacPorts installation was shared between Pos

pgsql: Look up backend type in pg_signal_backend() more cheaply.

2024-11-27 Thread Nathan Bossart
Look up backend type in pg_signal_backend() more cheaply. Commit ccd38024bc, which introduced the pg_signal_autovacuum_worker role, added a call to pgstat_get_beentry_by_proc_number() for the purpose of determining whether the process is an autovacuum worker. This function calls pgstat_read_curren

pgsql: pgbench: Ensure previous progress message is fully cleared when

2024-11-27 Thread Fujii Masao
pgbench: Ensure previous progress message is fully cleared when updating. During pgbench's table initialization, progress updates could display leftover characters from the previous message if the new message was shorter. This commit resolves the issue by appending spaces to the current message to

pgsql: pgbench: Ensure previous progress message is fully cleared when

2024-11-27 Thread Fujii Masao
pgbench: Ensure previous progress message is fully cleared when updating. During pgbench's table initialization, progress updates could display leftover characters from the previous message if the new message was shorter. This commit resolves the issue by appending spaces to the current message to

pgsql: pgbench: Ensure previous progress message is fully cleared when

2024-11-27 Thread Fujii Masao
pgbench: Ensure previous progress message is fully cleared when updating. During pgbench's table initialization, progress updates could display leftover characters from the previous message if the new message was shorter. This commit resolves the issue by appending spaces to the current message to

pgsql: Make GUC_check_errdetail messages full sentences

2024-11-27 Thread Álvaro Herrera
Make GUC_check_errdetail messages full sentences They were all missing punctuation, one was missing initial capital. Per our message style guidelines. No backpatch, to avoid breaking existing translations. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6ba9892f5cb

pgsql: Remove redundant relam initialization

2024-11-27 Thread Álvaro Herrera
Remove redundant relam initialization This struct member is initialized again a few lines below in the same function. This is cosmetic, so no backpatch. Reported-by: Jingtang Zhang Discussion: https://postgr.es/m/aff74506-b925-46bb-b875-cf5a94617...@gmail.com Branch -- master Details

pgsql: postmaster: Reduce verbosity of environment dump debug message

2024-11-27 Thread Andres Freund
postmaster: Reduce verbosity of environment dump debug message Emitting each variable separately is unnecessarily verbose / hard to skim over. Emit the whole thing in one ereport() to address that. Also remove program name and function reference from the message. The former doesn't seem particula

pgsql: ecpg: clean up some other assorted memory leaks.

2024-11-27 Thread Tom Lane
ecpg: clean up some other assorted memory leaks. Avoid leaking the prior value when updating the "connection" state variable. Ditto for ECPGstruct_sizeof. (It seems like this one ought to be statement-local, but testing says it isn't, and I didn't feel like diving deeper.) The actual_type[] ent

pgsql: Require sizeof(bool) == 1.

2024-11-27 Thread Thomas Munro
Require sizeof(bool) == 1. The C standard says that sizeof(bool) is implementation-defined, but we know of no current systems where it is not 1. The last known systems seem to have been Apple macOS/PowerPC 10.5 and Microsoft Visual C++ 4, both long defunct. PostgreSQL has always required sizeof(

pgsql: Revert "Handle better implicit transaction state of pipeline mod

2024-11-27 Thread Michael Paquier
Revert "Handle better implicit transaction state of pipeline mode" This reverts commit d77f91214fb7 on all stable branches, due to concerns regarding the compatility side effects this could create in a minor release. The change still exists on HEAD. Discussion: https://postgr.es/m/ca+tgmozqrgef

pgsql: Revert "Handle better implicit transaction state of pipeline mod

2024-11-27 Thread Michael Paquier
Revert "Handle better implicit transaction state of pipeline mode" This reverts commit d77f91214fb7 on all stable branches, due to concerns regarding the compatility side effects this could create in a minor release. The change still exists on HEAD. Discussion: https://postgr.es/m/ca+tgmozqrgef

pgsql: Revert "Handle better implicit transaction state of pipeline mod

2024-11-27 Thread Michael Paquier
Revert "Handle better implicit transaction state of pipeline mode" This reverts commit d77f91214fb7 on all stable branches, due to concerns regarding the compatility side effects this could create in a minor release. The change still exists on HEAD. Discussion: https://postgr.es/m/ca+tgmozqrgef

pgsql: Revert "Handle better implicit transaction state of pipeline mod

2024-11-27 Thread Michael Paquier
Revert "Handle better implicit transaction state of pipeline mode" This reverts commit d77f91214fb7 on all stable branches, due to concerns regarding the compatility side effects this could create in a minor release. The change still exists on HEAD. Discussion: https://postgr.es/m/ca+tgmozqrgef

pgsql: Revert "Handle better implicit transaction state of pipeline mod

2024-11-27 Thread Michael Paquier
Revert "Handle better implicit transaction state of pipeline mode" This reverts commit d77f91214fb7 on all stable branches, due to concerns regarding the compatility side effects this could create in a minor release. The change still exists on HEAD. Discussion: https://postgr.es/m/ca+tgmozqrgef

pgsql: Fix typo

2024-11-27 Thread Peter Eisentraut
Fix typo from commit 9044fc1d45a Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/41272784b9383910de737937f1987dd00246f728 Modified Files -- src/tools/pgindent/exclude_file_patterns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: gitattributes: Add .cpp files to whitespace checks

2024-11-27 Thread Peter Eisentraut
gitattributes: Add .cpp files to whitespace checks Use the same rules as .c files. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0d884f570b72c5b030f7908032946078537ea121 Modified Files -- .gitattributes | 1 + 1 file changed, 1 insertion(+)

pgsql: Exclude LLVM files from whitespace checks

2024-11-27 Thread Peter Eisentraut
Exclude LLVM files from whitespace checks Commit 9044fc1d45a added some files from upstream LLVM. These files have different whitespace rules, which make the git whitespace checks powered by gitattributes fail. To fix, add those files to the exclude list. Branch -- master Details --- h

pgsql: Improve slightly misleading internal error message

2024-11-27 Thread Peter Eisentraut
Improve slightly misleading internal error message The error message was talking about RowCompareType but was actually checking strategy numbers. While those are closely related, it is better to be accurate. Discussion: https://www.postgresql.org/message-id/flat/e72eaa49-354d-4c2e-8eb9-255197f5

pgsql: Fix buildfarm failure from commit 8fcd80258b.

2024-11-27 Thread Amit Kapila
Fix buildfarm failure from commit 8fcd80258b. The test case was incorrectly matching the error code. Author: Vignesh C Discussion: https://postgr.es/m/CALDaNm0C5LPiTxkdqsxiyeaL=nuUP8t6ne81sp9jE0=MFz=-e...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitd

pgsql: Require ucrt if using MinGW.

2024-11-27 Thread Thomas Munro
Require ucrt if using MinGW. Historically we tolerated the absence of various C runtime library features for the benefit of the MinGW tool chain, because it used ancient msvcrt.dll for a long period of time. It now uses ucrt by default (like Windows 10+, Visual Studio 2015+), and that's the only

pgsql: Exclude LLVM files from whitespace checks

2024-11-27 Thread Peter Eisentraut
Exclude LLVM files from whitespace checks Commit 9044fc1d45a added some files from upstream LLVM. These files have different whitespace rules, which make the git whitespace checks powered by gitattributes fail. To fix, add those files to the exclude list. Branch -- REL_16_STABLE Details --

pgsql: Fix typo

2024-11-27 Thread Peter Eisentraut
Fix typo from commit 9044fc1d45a Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7786717b9e5d0e7ad828a7c7a65c74732ec492a9 Modified Files -- src/tools/pgindent/exclude_file_patterns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Exclude LLVM files from whitespace checks

2024-11-27 Thread Peter Eisentraut
Exclude LLVM files from whitespace checks Commit 9044fc1d45a added some files from upstream LLVM. These files have different whitespace rules, which make the git whitespace checks powered by gitattributes fail. To fix, add those files to the exclude list. Branch -- REL_15_STABLE Details --

pgsql: Remove configure check for _configthreadlocale().

2024-11-27 Thread Thomas Munro
Remove configure check for _configthreadlocale(). All modern Windows systems have _configthreadlocale(). It was first introduced in msvcr80.dll from Visual Studio 2005. Historically, MinGW was stuck on even older msvcrt.dll, but added its own dummy implementation of the function when using msvcr

pgsql: Fix typo

2024-11-27 Thread Peter Eisentraut
Fix typo from commit 9044fc1d45a Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/4c0e70fc30e4800beb89af5dff44ab5f37fe6720 Modified Files -- src/tools/pgindent/exclude_file_patterns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Exclude LLVM files from whitespace checks

2024-11-27 Thread Peter Eisentraut
Exclude LLVM files from whitespace checks Commit 9044fc1d45a added some files from upstream LLVM. These files have different whitespace rules, which make the git whitespace checks powered by gitattributes fail. To fix, add those files to the exclude list. Branch -- REL_13_STABLE Details --

pgsql: Exclude LLVM files from whitespace checks

2024-11-27 Thread Peter Eisentraut
Exclude LLVM files from whitespace checks Commit 9044fc1d45a added some files from upstream LLVM. These files have different whitespace rules, which make the git whitespace checks powered by gitattributes fail. To fix, add those files to the exclude list. Branch -- REL_14_STABLE Details --

pgsql: Fix typo

2024-11-27 Thread Peter Eisentraut
Fix typo from commit 9044fc1d45a Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/f2353d03cd0d81ae1829362dcbde85467ea828fd Modified Files -- src/tools/pgindent/exclude_file_patterns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo

2024-11-27 Thread Peter Eisentraut
Fix typo from commit 9044fc1d45a Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/56265ed6a12c3ccf13a1a702748fcab8d1c6111b Modified Files -- src/tools/pgindent/exclude_file_patterns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Exclude LLVM files from whitespace checks

2024-11-27 Thread Peter Eisentraut
Exclude LLVM files from whitespace checks Commit 9044fc1d45a added some files from upstream LLVM. These files have different whitespace rules, which make the git whitespace checks powered by gitattributes fail. To fix, add those files to the exclude list. Branch -- REL_17_STABLE Details --

pgsql: Revert "Blind attempt to fix _configthreadlocale() failures on M

2024-11-27 Thread Thomas Munro
Revert "Blind attempt to fix _configthreadlocale() failures on MinGW." This reverts commit 2cf91ccb73ce888c44e3751548fb7c77e87335f2. When using the old msvcrt.dll, MinGW would supply its own dummy version of _configthreadlocale() that just returns -1 if you try to use it. For a time we tolerated

pgsql: Fix pg_get_constraintdef for NOT NULL constraints on domains

2024-11-27 Thread Álvaro Herrera
Fix pg_get_constraintdef for NOT NULL constraints on domains We added pg_constraint rows for all not-null constraints, first for tables and later for domains; but while the ones for tables were reverted, the ones for domains were not. However, we did accidentally revert ruleutils.c support for th

pgsql: Fix pg_get_constraintdef for NOT NULL constraints on domains

2024-11-27 Thread Álvaro Herrera
Fix pg_get_constraintdef for NOT NULL constraints on domains We added pg_constraint rows for all not-null constraints, first for tables and later for domains; but while the ones for tables were reverted, the ones for domains were not. However, we did accidentally revert ruleutils.c support for th