pgsql: Remove TRACE_SORT macro

2024-08-13 Thread Peter Eisentraut
Remove TRACE_SORT macro The TRACE_SORT macro guarded the availability of the trace_sort GUC setting. But it has been enabled by default ever since it was introduced in PostgreSQL 8.1, and there have been no reports that someone wanted to disable it. So just remove the macro to simplify things.

pgsql: Harmonize MinGW CODESET lookup with MSVC.

2024-08-13 Thread Thomas Munro
Harmonize MinGW CODESET lookup with MSVC. Historically, MinGW environments lacked some Windows API calls, so we took a different code path in win32_langinfo(). Somehow, the code change in commit 35eeea62 (removing setlocale() calls) caused one particular 001_initdb.pl test to fail on MinGW + ICU

pgsql: Add resource statistics reporting to ANALYZE VERBOSE.

2024-08-13 Thread Masahiko Sawada
Add resource statistics reporting to ANALYZE VERBOSE. Previously, log_autovacuum_min_duration utilized dedicated code for logging resource statistics, such as system and buffer usage during autoanalyze. However, this logging functionality was not utilized by ANALYZE VERBOSE. This commit adds reso

Re: pgsql: Fix more holes with SLRU code in need of int64 for segment numbe

2024-08-13 Thread Alexander Korotkov
On Tue, Aug 13, 2024 at 1:30 AM Michael Paquier wrote: > > On Aug 13, 2024, at 6:35, Alexander Korotkov wrote:. > > > > As pointed by Noah Misch [1], unlike the commit the patch [2] also > > changed segment-returning functions to return int64. Thus, in the > > patch output formats make much more

pgsql: Use pgBufferUsage for buffer usage tracking in analyze.

2024-08-13 Thread Masahiko Sawada
Use pgBufferUsage for buffer usage tracking in analyze. Previously, (auto)analyze used global variables VacuumPageHit, VacuumPageMiss, and VacuumPageDirty to track buffer usage. However, pgBufferUsage provides a more generic way to track buffer usage with support functions. This change replaces t

pgsql: Include for macOS, take II.

2024-08-13 Thread Thomas Munro
Include for macOS, take II. Fix typo in macro name. Discussion: https://postgr.es/m/CA%2BhUKG%2Bk-o3N_SyNJNJpAcdtMo_HheN30miAeXehk9yw%3D9WYzA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2488058dc356a43455b21a099ea879fff9266634 Modified Files

pgsql: Include for older macOS.

2024-08-13 Thread Thomas Munro
Include for older macOS. Commit 35eeea62 forgot to include when using locale_t (which didn't seem to be required on newer Apple SDK as used by CI, hence mistake). Let's see if this fixes build farm animals longfin and sifika. Branch -- master Details --- https://git.postgresql.org/pg/

pgsql: All POSIX systems have langinfo.h and CODESET.

2024-08-13 Thread Thomas Munro
All POSIX systems have langinfo.h and CODESET. We don't need configure probes for HAVE_LANGINFO_H (it is implied by !WIN32), and we don't need to consider systems that have it but don't define CODESET (that was for OpenBSD in commit 81cca218, but it has now had it for 19 years). Reviewed-by: Heik

pgsql: Use thread-safe nl_langinfo_l(), not nl_langinfo().

2024-08-13 Thread Thomas Munro
Use thread-safe nl_langinfo_l(), not nl_langinfo(). This gets rid of some setlocale() calls. The remaining call to setlocale() in pg_get_encoding_from_locale() is a query of the name of the current locale when none was provided (in a multi-threaded future that would need more work). All known no

pgsql: Use errmsg_internal for debug messages

2024-08-13 Thread Peter Eisentraut
Use errmsg_internal for debug messages Some newer code was applying this inconsistently. Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/253c49e07599b8df5a51af69035f7d136de55c3a Modified Files -- src/backend/postmaster/walsummarizer.c | 24 ++

pgsql: Use errmsg_internal for debug messages

2024-08-13 Thread Peter Eisentraut
Use errmsg_internal for debug messages Some newer code was applying this inconsistently. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/93660d1c27b1b85e84621326c0e2c89e00c3fc6f Modified Files -- src/backend/postmaster/walsummarizer.c | 24 -