pgsql: Fix initialization of FDW batching in ExecInitModifyTable

2021-01-20 Thread Tomas Vondra
Fix initialization of FDW batching in ExecInitModifyTable ExecInitModifyTable has to initialize batching for all result relations, not just the first one. Furthermore, when junk filters were necessary, the pointer pointed past the mtstate->resultRelInfo array. Per reports from multiple non-x86 an

pgsql: Switch "cl /?" to "cl /help" in MSVC scripts for platform detect

2021-01-20 Thread Michael Paquier
Switch "cl /?" to "cl /help" in MSVC scripts for platform detection "cl /?" produces a different output if run on a real or a virtual drive (this can be set with a simple subst command), causing an error in the MSVC scripts if building on a virtual drive because the platform to use cannot be detec

pgsql: Implement support for bulk inserts in postgres_fdw

2021-01-20 Thread Tomas Vondra
Implement support for bulk inserts in postgres_fdw Extends the FDW API to allow batching inserts into foreign tables. That is usually much more efficient than inserting individual rows, due to high latency for each round-trip to the foreign server. It was possible to implement something similar i

pgsql: psql \dX: list extended statistics objects

2021-01-20 Thread Tomas Vondra
psql \dX: list extended statistics objects The new command lists extended statistics objects. All past releases with extended statistics are supported. This is a simplified version of commit 891a1d0bca, which had to be reverted due to not considering pg_statistic_ext_data is not accessible by reg

pgsql: Further tweaking of PG_SYSROOT heuristics for macOS.

2021-01-20 Thread Tom Lane
Further tweaking of PG_SYSROOT heuristics for macOS. It emerges that in some phases of the moon (perhaps to do with directory entry order?), xcrun will report that the SDK path is /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk which is normally a symlink to a version-numbered sibling direct

pgsql: Further tweaking of PG_SYSROOT heuristics for macOS.

2021-01-20 Thread Tom Lane
Further tweaking of PG_SYSROOT heuristics for macOS. It emerges that in some phases of the moon (perhaps to do with directory entry order?), xcrun will report that the SDK path is /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk which is normally a symlink to a version-numbered sibling direct

pgsql: Further tweaking of PG_SYSROOT heuristics for macOS.

2021-01-20 Thread Tom Lane
Further tweaking of PG_SYSROOT heuristics for macOS. It emerges that in some phases of the moon (perhaps to do with directory entry order?), xcrun will report that the SDK path is /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk which is normally a symlink to a version-numbered sibling direct

pgsql: Further tweaking of PG_SYSROOT heuristics for macOS.

2021-01-20 Thread Tom Lane
Further tweaking of PG_SYSROOT heuristics for macOS. It emerges that in some phases of the moon (perhaps to do with directory entry order?), xcrun will report that the SDK path is /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk which is normally a symlink to a version-numbered sibling direct

pgsql: Further tweaking of PG_SYSROOT heuristics for macOS.

2021-01-20 Thread Tom Lane
Further tweaking of PG_SYSROOT heuristics for macOS. It emerges that in some phases of the moon (perhaps to do with directory entry order?), xcrun will report that the SDK path is /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk which is normally a symlink to a version-numbered sibling direct

pgsql: Further tweaking of PG_SYSROOT heuristics for macOS.

2021-01-20 Thread Tom Lane
Further tweaking of PG_SYSROOT heuristics for macOS. It emerges that in some phases of the moon (perhaps to do with directory entry order?), xcrun will report that the SDK path is /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk which is normally a symlink to a version-numbered sibling direct

pgsql: Further tweaking of PG_SYSROOT heuristics for macOS.

2021-01-20 Thread Tom Lane
Further tweaking of PG_SYSROOT heuristics for macOS. It emerges that in some phases of the moon (perhaps to do with directory entry order?), xcrun will report that the SDK path is /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk which is normally a symlink to a version-numbered sibling direct

pgsql: Disable vacuum page skipping in selected test cases.

2021-01-20 Thread Tom Lane
Disable vacuum page skipping in selected test cases. By default VACUUM will skip pages that it can't immediately get exclusive access to, which means that even activities as harmless and unpredictable as checkpoint buffer writes might prevent a page from being processed. Ordinarily this is no big

pgsql: Disable vacuum page skipping in selected test cases.

2021-01-20 Thread Tom Lane
Disable vacuum page skipping in selected test cases. By default VACUUM will skip pages that it can't immediately get exclusive access to, which means that even activities as harmless and unpredictable as checkpoint buffer writes might prevent a page from being processed. Ordinarily this is no big

pgsql: Disable vacuum page skipping in selected test cases.

2021-01-20 Thread Tom Lane
Disable vacuum page skipping in selected test cases. By default VACUUM will skip pages that it can't immediately get exclusive access to, which means that even activities as harmless and unpredictable as checkpoint buffer writes might prevent a page from being processed. Ordinarily this is no big

pgsql: Disable vacuum page skipping in selected test cases.

2021-01-20 Thread Tom Lane
Disable vacuum page skipping in selected test cases. By default VACUUM will skip pages that it can't immediately get exclusive access to, which means that even activities as harmless and unpredictable as checkpoint buffer writes might prevent a page from being processed. Ordinarily this is no big

pgsql: Disable vacuum page skipping in selected test cases.

2021-01-20 Thread Tom Lane
Disable vacuum page skipping in selected test cases. By default VACUUM will skip pages that it can't immediately get exclusive access to, which means that even activities as harmless and unpredictable as checkpoint buffer writes might prevent a page from being processed. Ordinarily this is no big

pgsql: Fix bug in detecting concurrent page splits in GiST insert

2021-01-20 Thread Heikki Linnakangas
Fix bug in detecting concurrent page splits in GiST insert In commit 9eb5607e699, I got the condition on checking for split or deleted page wrong: I used && instead of ||. The comment correctly said "concurrent split _or_ deletion". As a result, GiST insertion could miss a concurrent split, and i

pgsql: Fix bug in detecting concurrent page splits in GiST insert

2021-01-20 Thread Heikki Linnakangas
Fix bug in detecting concurrent page splits in GiST insert In commit 9eb5607e699, I got the condition on checking for split or deleted page wrong: I used && instead of ||. The comment correctly said "concurrent split _or_ deletion". As a result, GiST insertion could miss a concurrent split, and i

pgsql: Fix bug in detecting concurrent page splits in GiST insert

2021-01-20 Thread Heikki Linnakangas
Fix bug in detecting concurrent page splits in GiST insert In commit 9eb5607e699, I got the condition on checking for split or deleted page wrong: I used && instead of ||. The comment correctly said "concurrent split _or_ deletion". As a result, GiST insertion could miss a concurrent split, and i

pgsql: Fix sample output of EXPLAIN ANALYZE.

2021-01-20 Thread Thomas Munro
Fix sample output of EXPLAIN ANALYZE. Since commit f0f13a3a08b2757997410f3a1c38bdc22973c525, we estimate ModifyTable paths without a RETURNING clause differently. Update an example from the manual that showed the old behavior. Author: Takayuki Tsunakawa Reviewed-by: Laurenz Albe Discussion: h