pgsql: Refactor logical worker synchronization code into a separate fil

2025-10-15 Thread Amit Kapila
Refactor logical worker synchronization code into a separate file. To support the upcoming addition of a sequence synchronization worker, this patch extracts common synchronization logic shared by table sync workers and the new sequence sync worker into a dedicated file. This modularization improv

pgsql: Fix EPQ crash from missing partition directory in EState

2025-10-15 Thread Amit Langote
Fix EPQ crash from missing partition directory in EState EvalPlanQualStart() failed to propagate es_partition_directory into the child EState used for EPQ rechecks. When execution time partition pruning ran during the EPQ scan, executor code dereferenced a NULL partition directory and crashed. Pr

pgsql: Add tests for logging of temporary file removal and statement

2025-10-15 Thread Michael Paquier
Add tests for logging of temporary file removal and statement Temporary file usage is sometimes attributed to the wrong query in the logs output. One identified reason is that unnamed portal cleanup (and consequently temp file logging) happens during the next BIND message as a, after debug_query_

pgsql: Fix EvalPlanQual handling of foreign/custom joins in ExecScanFet

2025-10-15 Thread Etsuro Fujita
Fix EvalPlanQual handling of foreign/custom joins in ExecScanFetch. If inside an EPQ recheck, ExecScanFetch would run the recheck method function for foreign/custom joins even if they aren't descendant nodes in the EPQ recheck plan tree, which is problematic at least in the foreign-join case, beca