pgsql: Doc: add some commentary about ExecutorRun's NoMovement special

2024-12-10 Thread Tom Lane
Doc: add some commentary about ExecutorRun's NoMovement special case. Robert Haas expressed concern about whether commit 3eea7a0c9 exposed the parallel-execution machinery to a case it isn't tested for, namely a second non-parallel execution of a plan after a parallel execution. Investigation show

pgsql: Fix elog(FATAL) before PostmasterMain() or just after fork().

2024-12-10 Thread Noah Misch
Fix elog(FATAL) before PostmasterMain() or just after fork(). Since commit 97550c0711972a9856b5db751539bbaf2f4c, these failed with "PANIC: proc_exit() called in child process" due to uninitialized or stale MyProcPid. That was reachable if close() failed in ClosePostmasterPorts() or setlocale

pgsql: Use in-place updates for pg_restore_relation_stats().

2024-12-10 Thread Jeff Davis
Use in-place updates for pg_restore_relation_stats(). This matches the behavior of vac_update_relstats(), which is important to avoid bloating pg_class. Author: Corey Huinker Discussion: https://postgr.es/m/CADkLM=fc3je+ufv3gshqjjssf+t8674rxpuxw62el55mueq...@mail.gmail.com Branch -- master

pgsql: Use ExprStates for hashing in GROUP BY and SubPlans

2024-12-10 Thread David Rowley
Use ExprStates for hashing in GROUP BY and SubPlans This speeds up obtaining hash values for GROUP BY and hashed SubPlans by using the ExprState support for hashing, thus allowing JIT compilation for obtaining hash values for these operations. This, even without JIT compilation, has been shown to

pgsql: Improve reporting of pg_upgrade log files on test failure

2024-12-10 Thread Michael Paquier
Improve reporting of pg_upgrade log files on test failure On failure, the pg_upgrade log files are automatically appended to the test log file, but the information reported was inconsistent. A header, with the log file name, was reported with note(), while the log contents and a footer used print

pgsql: Improve reporting of pg_upgrade log files on test failure

2024-12-10 Thread Michael Paquier
Improve reporting of pg_upgrade log files on test failure On failure, the pg_upgrade log files are automatically appended to the test log file, but the information reported was inconsistent. A header, with the log file name, was reported with note(), while the log contents and a footer used print

pgsql: Improve reporting of pg_upgrade log files on test failure

2024-12-10 Thread Michael Paquier
Improve reporting of pg_upgrade log files on test failure On failure, the pg_upgrade log files are automatically appended to the test log file, but the information reported was inconsistent. A header, with the log file name, was reported with note(), while the log contents and a footer used print

pgsql: Fix elog(FATAL) before PostmasterMain() or just after fork().

2024-12-10 Thread Noah Misch
Fix elog(FATAL) before PostmasterMain() or just after fork(). Since commit 97550c0711972a9856b5db751539bbaf2f4c, these failed with "PANIC: proc_exit() called in child process" due to uninitialized or stale MyProcPid. That was reachable if close() failed in ClosePostmasterPorts() or setlocale

pgsql: Speedup Hash Joins with dedicated functions for ExprState hashin

2024-12-10 Thread David Rowley
Speedup Hash Joins with dedicated functions for ExprState hashing Hashing of a single Var is a very common operation for ExprState to perform. Here we add dedicated ExecJust* functions which helps speed up Hash Joins by removing the interpretation overhead in ExecInterpExpr(). This change curren

pgsql: Tests for logical replication with temporal keys

2024-12-10 Thread Peter Eisentraut
Tests for logical replication with temporal keys This covers some cases that were previously failing before the "Support for GiST in get_equal_strategy_number()" patch. Author: Paul A. Jungwirth Reviewed-by: vignesh C Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a

pgsql: Support for GiST in get_equal_strategy_number()

2024-12-10 Thread Peter Eisentraut
Support for GiST in get_equal_strategy_number() A WITHOUT OVERLAPS primary key or unique constraint is accepted as a REPLICA IDENTITY, since it guarantees uniqueness. But subscribers applying logical decoding messages would fail because there was not support for looking up the equals operator for

pgsql: Replace get_equal_strategy_number_for_am() by get_equal_strategy

2024-12-10 Thread Peter Eisentraut
Replace get_equal_strategy_number_for_am() by get_equal_strategy_number() get_equal_strategy_number_for_am() gets the equal strategy number for an AM. This currently only supports btree and hash. In the more general case, this also depends on the operator class (see for example GistTranslateStra

pgsql: Improve internal logical replication error for missing equality

2024-12-10 Thread Peter Eisentraut
Improve internal logical replication error for missing equality strategy This "shouldn't happen", except right now it can with a temporal gist index (to be fixed soon), because of missing gist support in get_equal_strategy_number(). But right now, the error is not caught right away, but instead y

pgsql: Make the conditions in IsIndexUsableForReplicaIdentityFull() mor

2024-12-10 Thread Peter Eisentraut
Make the conditions in IsIndexUsableForReplicaIdentityFull() more explicit IsIndexUsableForReplicaIdentityFull() described a number of conditions that a suitable index has to fulfill. But not all of these were actually checked in the code. Instead, it appeared to rely on get_equal_strategy_numbe

pgsql: Fix elog(FATAL) before PostmasterMain() or just after fork().

2024-12-10 Thread Noah Misch
Fix elog(FATAL) before PostmasterMain() or just after fork(). Since commit 97550c0711972a9856b5db751539bbaf2f4c, these failed with "PANIC: proc_exit() called in child process" due to uninitialized or stale MyProcPid. That was reachable if close() failed in ClosePostmasterPorts() or setlocale

pgsql: Fix elog(FATAL) before PostmasterMain() or just after fork().

2024-12-10 Thread Noah Misch
Fix elog(FATAL) before PostmasterMain() or just after fork(). Since commit 97550c0711972a9856b5db751539bbaf2f4c, these failed with "PANIC: proc_exit() called in child process" due to uninitialized or stale MyProcPid. That was reachable if close() failed in ClosePostmasterPorts() or setlocale

pgsql: Improve reporting of pg_upgrade log files on test failure

2024-12-10 Thread Michael Paquier
Improve reporting of pg_upgrade log files on test failure On failure, the pg_upgrade log files are automatically appended to the test log file, but the information reported was inconsistent. A header, with the log file name, was reported with note(), while the log contents and a footer used print

pgsql: Fix elog(FATAL) before PostmasterMain() or just after fork().

2024-12-10 Thread Noah Misch
Fix elog(FATAL) before PostmasterMain() or just after fork(). Since commit 97550c0711972a9856b5db751539bbaf2f4c, these failed with "PANIC: proc_exit() called in child process" due to uninitialized or stale MyProcPid. That was reachable if close() failed in ClosePostmasterPorts() or setlocale

pgsql: Fix elog(FATAL) before PostmasterMain() or just after fork().

2024-12-10 Thread Noah Misch
Fix elog(FATAL) before PostmasterMain() or just after fork(). Since commit 97550c0711972a9856b5db751539bbaf2f4c, these failed with "PANIC: proc_exit() called in child process" due to uninitialized or stale MyProcPid. That was reachable if close() failed in ClosePostmasterPorts() or setlocale