pgsql: Reduce rate of walwriter wakeups due to async commits.

2023-11-27 Thread Heikki Linnakangas
Reduce rate of walwriter wakeups due to async commits. XLogSetAsyncXactLSN(), called at asynchronous commit, would wake up walwriter every time the LSN advances, but walwriter doesn't actually do anything unless it has at least 'wal_writer_flush_after' full blocks of WAL to write. Repeatedly wakin

pgsql: Check if ii_AmCache is NULL in aminsertcleanup

2023-11-27 Thread Tomas Vondra
Check if ii_AmCache is NULL in aminsertcleanup Fix a bug introduced by c1ec02be1d79. It may happen that the executor opens indexes on the result relation, but no rows end up being inserted. Then the index_insert_cleanup still gets executed, but passes down NULL to the AM callback. The AM callback

pgsql: Fix CREATE INDEX CONCURRENTLY example

2023-11-27 Thread Alvaro Herrera
Fix CREATE INDEX CONCURRENTLY example It fails to use the CONCURRENTLY keyword where it was necessary, so add it. This text was added to pg11 in commit 5efd604ec0a3; backpatch to pg12. Author: Nikolay Samokhvalov Discussion: https://postgr.es/m/CAM527d9iz6+=_c7eqskagzjqwvsecervvvhz1v3gdgjttvg.

pgsql: Fix CREATE INDEX CONCURRENTLY example

2023-11-27 Thread Alvaro Herrera
Fix CREATE INDEX CONCURRENTLY example It fails to use the CONCURRENTLY keyword where it was necessary, so add it. This text was added to pg11 in commit 5efd604ec0a3; backpatch to pg12. Author: Nikolay Samokhvalov Discussion: https://postgr.es/m/CAM527d9iz6+=_c7eqskagzjqwvsecervvvhz1v3gdgjttvg.

pgsql: Fix CREATE INDEX CONCURRENTLY example

2023-11-27 Thread Alvaro Herrera
Fix CREATE INDEX CONCURRENTLY example It fails to use the CONCURRENTLY keyword where it was necessary, so add it. This text was added to pg11 in commit 5efd604ec0a3; backpatch to pg12. Author: Nikolay Samokhvalov Discussion: https://postgr.es/m/CAM527d9iz6+=_c7eqskagzjqwvsecervvvhz1v3gdgjttvg.

pgsql: Fix CREATE INDEX CONCURRENTLY example

2023-11-27 Thread Alvaro Herrera
Fix CREATE INDEX CONCURRENTLY example It fails to use the CONCURRENTLY keyword where it was necessary, so add it. This text was added to pg11 in commit 5efd604ec0a3; backpatch to pg12. Author: Nikolay Samokhvalov Discussion: https://postgr.es/m/CAM527d9iz6+=_c7eqskagzjqwvsecervvvhz1v3gdgjttvg.

pgsql: Fix CREATE INDEX CONCURRENTLY example

2023-11-27 Thread Alvaro Herrera
Fix CREATE INDEX CONCURRENTLY example It fails to use the CONCURRENTLY keyword where it was necessary, so add it. This text was added to pg11 in commit 5efd604ec0a3; backpatch to pg12. Author: Nikolay Samokhvalov Discussion: https://postgr.es/m/CAM527d9iz6+=_c7eqskagzjqwvsecervvvhz1v3gdgjttvg.

pgsql: Fix CREATE INDEX CONCURRENTLY example

2023-11-27 Thread Alvaro Herrera
Fix CREATE INDEX CONCURRENTLY example It fails to use the CONCURRENTLY keyword where it was necessary, so add it. This text was added to pg11 in commit 5efd604ec0a3; backpatch to pg12. Author: Nikolay Samokhvalov Discussion: https://postgr.es/m/CAM527d9iz6+=_c7eqskagzjqwvsecervvvhz1v3gdgjttvg.

pgsql: Retire a few backwards compatibility macros.

2023-11-27 Thread Nathan Bossart
Retire a few backwards compatibility macros. As of commits dd04e958c8 and 1833f1a1c3, tuplestore_donestoring(), SPI_push(), SPI_pop(), SPI_push_conditional(), SPI_pop_conditional(), and SPI_restore_connection() are no-op macros provided for backwards compatibility. This commit removes these macro

Re: pgsql: meson: docs: Add {html,man} targets, rename install-doc-*

2023-11-27 Thread Andrew Dunstan
On 2023-11-23 Th 08:32, Andrew Dunstan wrote: On 2023-11-20 Mo 20:53, Andres Freund wrote: meson: docs: Add {html,man} targets, rename install-doc-* We have toplevel html, man targets in the autoconf build as well. It'd be odd to have an 'html' target but have the install target be 'install-

pgsql: Don't use bms_membership() in cases where we don't need to

2023-11-27 Thread David Rowley
Don't use bms_membership() in cases where we don't need to 00b41463c adjusted Bitmapset so that an empty set is always represented as NULL. This makes checking for empty sets far cheaper than it used to be. There were various places in the code where we'd call bms_membership() to handle the 3 po

pgsql: Add CHECK_FOR_INTERRUPTS() in scram_SaltedPassword() for the bac

2023-11-27 Thread Michael Paquier
Add CHECK_FOR_INTERRUPTS() in scram_SaltedPassword() for the backend scram_SaltedPassword() could take a long time to compute when the number of iterations used is large enough, and this code uses a tight loop to compute a salted password. Note that the same issue exists in libpq when using \pass

pgsql: Add CHECK_FOR_INTERRUPTS() in scram_SaltedPassword() for the bac

2023-11-27 Thread Michael Paquier
Add CHECK_FOR_INTERRUPTS() in scram_SaltedPassword() for the backend scram_SaltedPassword() could take a long time to compute when the number of iterations used is large enough, and this code uses a tight loop to compute a salted password. Note that the same issue exists in libpq when using \pass

pgsql: Fix comment in tableam.h about GetHeapamTableAmRoutine()

2023-11-27 Thread Michael Paquier
Fix comment in tableam.h about GetHeapamTableAmRoutine() This routine is located in heapam_handler.c, not tableamapi.c. Issue noted while hacking the area for a different patch. Reviewed-by: Richard Guo Discussion: https://postgr.es/m/zwquhltp2ks_0...@paquier.xyz Branch -- master Details -

pgsql: Remove test for pg_stat_reset_shared() in stats.sql

2023-11-27 Thread Michael Paquier
Remove test for pg_stat_reset_shared() in stats.sql Some buildfarm members have been failing a test related to pg_stat_io, as an effect of 23c8c0c8f472 that has switched pg_stat_reset_shared() from being a no-op to reset all shared stats types. This extra reset has the effect to make pg_stat_io's

Re: pgsql: Remove test for pg_stat_reset_shared() in stats.sql

2023-11-27 Thread Bharath Rupireddy
On Tue, Nov 28, 2023 at 9:51 AM Michael Paquier wrote: > > Remove test for pg_stat_reset_shared() in stats.sql > > Some buildfarm members have been failing a test related to pg_stat_io, > as an effect of 23c8c0c8f472 that has switched pg_stat_reset_shared() > from being a no-op to reset all shared

Re: pgsql: Remove test for pg_stat_reset_shared() in stats.sql

2023-11-27 Thread Michael Paquier
On Tue, Nov 28, 2023 at 10:21:33AM +0530, Bharath Rupireddy wrote: > Is there any reason for not removing [1] unneeded statements from > stats.sql like the attached? Ugh, thanks. I have somewhat missed that. -- Michael signature.asc Description: PGP signature