pgsql: Improve read_stream.c advice for dense streams.

2025-03-14 Thread Thomas Munro
Improve read_stream.c advice for dense streams. read_stream.c tries not to issue read-ahead advice when it thinks the kernel's own read-ahead should be active, ie when using buffered I/O and reading sequential blocks. It previously gave up too easily, and issued advice only for the first read of

pgsql: doc: Explain more thoroughly when a table rewrite is needed

2025-03-14 Thread Álvaro Herrera
doc: Explain more thoroughly when a table rewrite is needed Author: Masahiro Ikeda Reviewed-by: Robert Treat Discussion: https://postgr.es/m/00e6eb5f5c793b8ef722252c7a519...@oss.nttdata.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/11bd8318602fc2282a6201f714

pgsql: Remove direct handling of reloptions for toast tables

2025-03-14 Thread Álvaro Herrera
Remove direct handling of reloptions for toast tables It doesn't actually work, even with allow_system_table_mods turned on: the ALTER TABLE operation is rejected by ATSimplePermissions(), so even the error message we're adding in this commit is unreachable. Add a test case for it. Author: Nikol

pgsql: Activate Python "Limited API" in PL/Python

2025-03-14 Thread Peter Eisentraut
Activate Python "Limited API" in PL/Python This allows building PL/Python against any Python 3.x version and using another Python 3.x version at run time. This is useful for installers that want to run against a separately downloaded Python, so that they don't have to bundle it themselves. This

pgsql: Respect changing pin limits in read_stream.c.

2025-03-14 Thread Thomas Munro
Respect changing pin limits in read_stream.c. To avoid pinning too much of the buffer pool at once, read_stream.c previously used LimitAdditionalPins(). The coding was naive, and only considered the available buffers at stream construction time. This commit checks before each StartReadBuffers()

pgsql: Optimize iteration over PGPROC for fast-path lock searches.

2025-03-14 Thread Fujii Masao
Optimize iteration over PGPROC for fast-path lock searches. This commit improves efficiency in FastPathTransferRelationLocks() and GetLockConflicts(), which iterate over PGPROCs to search for fast-path locks. Previously, these functions recalculated the fast-path group during every loop iteration

pgsql: Add GUC option to log lock acquisition failures.

2025-03-14 Thread Fujii Masao
Add GUC option to log lock acquisition failures. This commit introduces a new GUC, log_lock_failure, which controls whether a detailed log message is produced when a lock acquisition fails. Currently, it only supports logging lock failures caused by SELECT ... NOWAIT. The log message includes inf