pgsql: ICU: check for U_STRING_NOT_TERMINATED_WARNING.

2023-05-17 Thread Jeff Davis
ICU: check for U_STRING_NOT_TERMINATED_WARNING. Fixes memory error in cases where the length of the language name returned by uloc_getLanguage() is exactly ULOC_LANG_CAPACITY, in which case the status is set to U_STRING_NOT_TERMINATED_WARNING. Also check in call sites for other ICU functions that

pgsql: Reduce icu_validation_level default to WARNING.

2023-05-17 Thread Jeff Davis
Reduce icu_validation_level default to WARNING. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6de31ce446e59a1f947c7ebe4e4bbe7ca2b842bc Modified Files -- doc/sr

pgsql: Fix error message wordings

2023-05-17 Thread Peter Eisentraut
Fix error message wordings The original patch for percentrepl.c c96de2ce17 adopted the error messages from basebackup_to_shell, but that uses terminology that doesn't really fit with the new API naming. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/009bd237bf6db64

pgsql: Add writeback to pg_stat_io

2023-05-17 Thread Andres Freund
Add writeback to pg_stat_io 28e626bde00 added the concept of IOOps but neglected to include writeback operations. ac8d53dae5 added time spent doing these I/O operations. Without counting writeback, checkpointer write time in the log often differed substantially from that in pg_stat_io. To fix this

pgsql: Use BUFFER_USAGE_LIMIT to reduce needed test table size

2023-05-17 Thread Andres Freund
Use BUFFER_USAGE_LIMIT to reduce needed test table size Using the minimum BUFFER_USAGE_LIMIT value, we can make one of the pg_stat_io test tables smaller while still causing reuses. Author: Melanie Plageman Discussion: https://postgr.es/m/CAAKRu_acc6iL4M3hvOTeztf_ZPpsB3Pqio5aVHgZ5q=pi3b...@mail

pgsql: Update parameter name context to wb_context

2023-05-17 Thread Andres Freund
Update parameter name context to wb_context For clarity of review, renaming the function parameter "context" in ScheduleBufferTagForWriteback() and IssuePendingWritebacks() to "wb_context" is a separate commit. The next commit adds an "io_context" parameter and "wb_context" makes it more clear whi

pgsql: Revert "Add USER SET parameter values for pg_db_role_setting"

2023-05-17 Thread Alexander Korotkov
Revert "Add USER SET parameter values for pg_db_role_setting" This reverts commit 096dd80f3ccc and its fixups beecbe8e5001, afdd9f7f0e00, 529da086ba, db93e739ac61. Catversion is bumped. Discussion: https://postgr.es/m/d46f9265-ff3c-6743-2278-6772598233c2%40pgmasters.net Branch -- master D

pgsql: pg_dump: Error message improvements

2023-05-17 Thread Alvaro Herrera
pg_dump: Error message improvements Remove spurious semicolon from one error message, and print the offending value of a parameter reported as invalid in another. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/58dc80acc5ebf12223be90db1a97dc0b31ca4e1f Modified File

pgsql: pg_dump: Have _EndLO report errno after CFH->write_func() failur

2023-05-17 Thread Alvaro Herrera
pg_dump: Have _EndLO report errno after CFH->write_func() failure Other callers of that function do things this way, but this one didn't get the memo. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/98bd4c72fd6c4f9d6a2b3b449cb89f335116ab5a Modified Files --

pgsql: Track tlist_vinfo.varnullingrels even in non-Assert builds.

2023-05-17 Thread Tom Lane
Track tlist_vinfo.varnullingrels even in non-Assert builds. Oversight in commit 867be9c07 (which should get reverted along with that, if we ever do revert it). Per buildfarm. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/69c430626b5eb44825a12e8bc90a59a90c4f5a03

pgsql: Fix some issues with improper placement of outer join clauses.

2023-05-17 Thread Tom Lane
Fix some issues with improper placement of outer join clauses. After applying outer-join identity 3 in the forward direction, it was possible for the planner to mistakenly apply a qual clause from above the two outer joins at the now-lower join level. This can give the wrong answer, since a value

pgsql: Convert nullingrels match checks from Asserts to test-and-elog.

2023-05-17 Thread Tom Lane
Convert nullingrels match checks from Asserts to test-and-elog. It seems like the code that these checks are backstopping may have a few bugs left in it. Use a test-and-elog so that the tests are performed even in non-assert builds, and so that we get something more informative than "server close

pgsql: Advance input pointer when LZ4 compressing data

2023-05-17 Thread Tomas Vondra
Advance input pointer when LZ4 compressing data LZ4File_write() did not advance the input pointer on subsequent invocations of LZ4F_compressUpdate(). As a result the generated compressed output would be a compressed version of the same input chunk. Tests failed to catch this error because the dat

Re: pgsql: Null-terminate the output buffer of LZ4Stream_gets

2023-05-17 Thread Thom Brown
On Wed, 17 May 2023 at 15:38, Tomas Vondra wrote: > > Null-terminate the output buffer of LZ4Stream_gets > > LZ4Stream_gets did not null-terminate its output buffer. The callers expected > the buffer to be null-terminated and passed it around to functions such as > sscanf with unintended consequen

pgsql: Null-terminate the output buffer of LZ4Stream_gets

2023-05-17 Thread Tomas Vondra
Null-terminate the output buffer of LZ4Stream_gets LZ4Stream_gets did not null-terminate its output buffer. The callers expected the buffer to be null-terminated and passed it around to functions such as sscanf with unintended consequences. Author: Georgios Kokolatos Reported-by: Alexander Lakhi

Re: pgsql: Refactor background psql TAP functions

2023-05-17 Thread Daniel Gustafsson
> On 16 May 2023, at 21:43, Daniel Gustafsson > wrote: > >> On 16 May 2023, at 21:04, Damir Belyalov wrote: > >> There is another perl module: AdjustUpgrade.pm that is not in Makefile. Do >> we need it? > > Yes, I think it should be installed too and skimming the linked thread I see > no >