pgsql: Allow roles created by new test to log in under SSPI.

2024-10-08 Thread Tom Lane
Allow roles created by new test to log in under SSPI. Semi-blind attempt to fix 6a1d0d470 to work on Windows, along the same lines as a70f2a57f. Per buildfarm. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/97354286619904bbfd2607b14f3f0d01926e95d0 Modified Files

pgsql: pg_stat_statements: Add columns to track parallel worker activit

2024-10-08 Thread Michael Paquier
pg_stat_statements: Add columns to track parallel worker activity The view pg_stat_statements gains two columns: - parallel_workers_to_launch, the number of parallel workers planned to be launched. - parallel_workers_launched, the number of parallel workers actually launched. The ratio of both co

pgsql: Introduce two fields in EState to track parallel worker activity

2024-10-08 Thread Michael Paquier
Introduce two fields in EState to track parallel worker activity These fields can be set by executor nodes to record how many parallel workers were planned to be launched and how many of them have been actually launched within the number initially planned. This data is able to give an approximati

pgsql: Silence assorted annoying test output.

2024-10-08 Thread Tom Lane
Silence assorted annoying test output. Remove unnecessary chatter about "checking if IO::Socket::UNIX works"; our tests should never print anything on stderr unless there's a problem. Add .gitignore entry for temporary directory now being left behind in src/test/postmaster. Branch -- master

pgsql: Add min and max aggregates for bytea type.

2024-10-08 Thread Tom Lane
Add min and max aggregates for bytea type. Similar to a0f1fce80, although we chose to duplicate logic rather than invoke byteacmp, primarily to avoid repeat detoasting. Marat Buharov, Aleksander Alekseev Discussion: https://postgr.es/m/capcevgxiasjodos4p8pgyv7ixfvn-zgg9yyirzrbvqbgmfu...@mail.gm

pgsql: bufmgr: Return early in ScheduleBufferTagForWriteback() if fsync

2024-10-08 Thread Andres Freund
bufmgr: Return early in ScheduleBufferTagForWriteback() if fsync=off As pg_flush_data() doesn't do anything with fsync disabled, there's no point in tracking the buffer for writeback. Arguably the better fix would be to change pg_flush_data() to flush data even with fsync off, but that's a behavio

pgsql: Use aux process resource owner in walsender

2024-10-08 Thread Andres Freund
Use aux process resource owner in walsender AIO will need a resource owner to do IO. Right now we create a resowner on-demand during basebackup, and we could do the same for AIO. But it seems easier to just always create an aux process resowner. Reviewed-by: Heikki Linnakangas Reviewed-by: Noah

pgsql: bufmgr/smgr: Don't cross segment boundaries in StartReadBuffers(

2024-10-08 Thread Andres Freund
bufmgr/smgr: Don't cross segment boundaries in StartReadBuffers() With real AIO it doesn't make sense to cross segment boundaries with one IO. Add smgrmaxcombine() to allow upper layers to query which buffers can be merged. We could continue to cross segment boundaries when not using AIO, but it

pgsql: Silence buildfarm warning chatter from bd1276a3c.

2024-10-08 Thread Tom Lane
Silence buildfarm warning chatter from bd1276a3c. Buildfarm members using -Wextra complained about "warning: suggest braces around empty body in an 'if' statement". Do it gcc's way, though I see no actual readability benefit in this. Branch -- master Details --- https://git.postgresql.o

pgsql: Fix typo and run pgperltidy on newly-added test

2024-10-08 Thread Heikki Linnakangas
Fix typo and run pgperltidy on newly-added test From commit 85ec945b78. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/05d1b9b5c286424dea2a91cf906c49c9d22ff4bf Modified Files -- src/test/postmaster/t/001_connection_limits.pl | 3 ++- 1 file changed, 2 i

pgsql: Add test for dead-end backends

2024-10-08 Thread Heikki Linnakangas
Add test for dead-end backends The code path for launching a dead-end backend because we're out of slots was not covered by any tests, so add one. (Some tests did hit the case of launching a dead-end backend because the server is still starting up, though, so the gap in our test coverage wasn't as

pgsql: Add test for connection limits

2024-10-08 Thread Heikki Linnakangas
Add test for connection limits Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/a102f15f-eac4-4ff2-af02-f9ff209ec...@iki.fi Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6a1d0d470e84f960a50cbe0cd1e2eee4b8c9baa5 Modified Files ---

pgsql: Use an shmem_exit callback to remove backend from PMChildFlags o

2024-10-08 Thread Heikki Linnakangas
Use an shmem_exit callback to remove backend from PMChildFlags on exit This seems nicer than having to duplicate the logic between InitProcess() and ProcKill() for which child processes have a PMChildFlags slot. Move the MarkPostmasterChildActive() call earlier in InitProcess(), out of the sectio

pgsql: Doc: add check to detect non-breaking spaces in the docs.

2024-10-08 Thread Tatsuo Ishii
Doc: add check to detect non-breaking spaces in the docs. There were multiple instances where accidentally adding non-breaking space (nbsp, U+00A0, 0xc2a0 in UTF-8) to sgml files. This commit adds additional checking to detect nbsp. You can check the nbsp by: make -C doc/src/sgml check or make

pgsql: Move check for binary mode and on_error option to the appropriat

2024-10-08 Thread Fujii Masao
Move check for binary mode and on_error option to the appropriate location. Commit 9e2d870119 placed the check for binary mode and on_error before default values were inserted, which was not ideal. This commit moves the check to a more appropriate position after default values are set. Additional

pgsql: Add REJECT_LIMIT option to the COPY command.

2024-10-08 Thread Fujii Masao
Add REJECT_LIMIT option to the COPY command. Previously, when ON_ERROR was set to 'ignore', the COPY command would skip all rows with data type conversion errors, with no way to limit the number of skipped rows before failing. This commit introduces the REJECT_LIMIT option, allowing users to spec

pgsql: Stabilize the test added by commit 022564f60c.

2024-10-08 Thread Amit Kapila
Stabilize the test added by commit 022564f60c. The test was unstable in branches 14 and 15 as we were relying on the number of changes in the table having a toast column to start streaming. On branches >= 16, we have a GUC debug_logical_replication_streaming which can stream each change, so the te

pgsql: Stabilize the test added by commit 022564f60c.

2024-10-08 Thread Amit Kapila
Stabilize the test added by commit 022564f60c. The test was unstable in branches 14 and 15 as we were relying on the number of changes in the table having a toast column to start streaming. On branches >= 16, we have a GUC debug_logical_replication_streaming which can stream each change, so the te

pgsql: Stabilize the test added by commit 022564f60c.

2024-10-08 Thread Amit Kapila
Stabilize the test added by commit 022564f60c. The test was unstable in branches 14 and 15 as we were relying on the number of changes in the table having a toast column to start streaming. On branches >= 16, we have a GUC debug_logical_replication_streaming which can stream each change, so the te

pgsql: Stabilize the test added by commit 022564f60c.

2024-10-08 Thread Amit Kapila
Stabilize the test added by commit 022564f60c. The test was unstable in branches 14 and 15 as we were relying on the number of changes in the table having a toast column to start streaming. On branches >= 16, we have a GUC debug_logical_replication_streaming which can stream each change, so the te

pgsql: Stabilize the test added by commit 022564f60c.

2024-10-08 Thread Amit Kapila
Stabilize the test added by commit 022564f60c. The test was unstable in branches 14 and 15 as we were relying on the number of changes in the table having a toast column to start streaming. On branches >= 16, we have a GUC debug_logical_replication_streaming which can stream each change, so the te