pgsql: Fix generation of distribution tarball

2023-12-19 Thread Michael Paquier
Fix generation of distribution tarball 1301c80b2167 has introduced in installation.sgml a link reference that `make dist` was not able to understand. Per buildfarm member guaibasaurus. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/00498b718564cee3530b76d860b32871

pgsql: Use 64-bit atomics for xlblocks array elements.

2023-12-19 Thread Jeff Davis
Use 64-bit atomics for xlblocks array elements. In preparation for reading the contents of WAL buffers without a lock. Also, avoids the previously-needed comment in GetXLogBuffer() explaining why it's safe from torn reads. Author: Bharath Rupireddy Discussion: https://postgr.es/m/calj2acvffmfqd5

pgsql: Additional write barrier in AdvanceXLInsertBuffer().

2023-12-19 Thread Jeff Davis
Additional write barrier in AdvanceXLInsertBuffer(). First, mark the xlblocks member with InvalidXLogRecPtr, then issue a write barrier, then initialize it. That ensures that the xlblocks member doesn't appear valid while the contents are being initialized. In preparation for reading WAL buffer c

Re: pgsql: Move src/bin/pg_verifybackup/parse_manifest.c into src/common.

2023-12-19 Thread Michael Paquier
On Tue, Dec 19, 2023 at 08:29:18PM +, Robert Haas wrote: > Move src/bin/pg_verifybackup/parse_manifest.c into src/common. > > This makes it possible for the code to be easily reused by other > client-side tools, and/or by the server. > > Patch by me. Review of this patch in particular by at l

pgsql: Remove MSVC scripts

2023-12-19 Thread Michael Paquier
Remove MSVC scripts This commit removes all the scripts located in src/tools/msvc/ to build PostgreSQL with Visual Studio on Windows, meson becoming the recommended way to achieve that. The scripts held some information that is still relevant with meson, information kept and moved to better locat

pgsql: basic_archive: Fix comments related to NO_INSTALLCHECK

2023-12-19 Thread Michael Paquier
basic_archive: Fix comments related to NO_INSTALLCHECK These comments incorrectly referred to shared_preload_libraries as being required for the test to work. Thinko in commit c68a1839902d. Author: Bharath Rupireddy Discussion: https://postgr.es/m/CALj2ACXpjFDiXf-L7AARQ4ppuxiDYSKZjyZb=woa+cgg0z

pgsql: Move src/bin/pg_verifybackup/parse_manifest.c into src/common.

2023-12-19 Thread Robert Haas
Move src/bin/pg_verifybackup/parse_manifest.c into src/common. This makes it possible for the code to be easily reused by other client-side tools, and/or by the server. Patch by me. Review of this patch in particular by at least Peter Eisentraut; reviewers for the patch series in general include

pgsql: Fix brown paper bag bug in 5c47c6546c413d5eb51c1626070a807026e61

2023-12-19 Thread Robert Haas
Fix brown paper bag bug in 5c47c6546c413d5eb51c1626070a807026e6139d. The previous logic failed to work for anything other than the first segment of a relation. Report by Jakub Wartak. Patch by me. Discussion: http://postgr.es/m/cakzirmwd3ktnmqhm9bv4or_1umehxroo6kgyjqkiw9dfm8c...@mail.gmail.com

pgsql: Prevent integer overflow when forming tuple width estimates.

2023-12-19 Thread Tom Lane
Prevent integer overflow when forming tuple width estimates. It's at least theoretically possible to overflow int32 when adding up column width estimates to make a row width estimate. (The bug example isn't terribly convincing as a real use-case, but perhaps wide joins would provide a more plausi

pgsql: Update comment for Cardinality typedef

2023-12-19 Thread Peter Eisentraut
Update comment for Cardinality typedef Author: Richard Guo Discussion: https://www.postgresql.org/message-id/flat/CAMbWs4-Zd7Yy80RL1NdskLLo-wz6QoqsbC5TKs%3D3yZxG3BT_aA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2a607fb822a2ad8f3a2cc714871283a

pgsql: doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example

2023-12-19 Thread Daniel Gustafsson
doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example The example for dropping an option was incorrectly quoting the option key thus making it a value turning the command into an unqualified ADD operation. The result of dropping became adding a new key/value pair instead: d=# alter foreign data

pgsql: doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example

2023-12-19 Thread Daniel Gustafsson
doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example The example for dropping an option was incorrectly quoting the option key thus making it a value turning the command into an unqualified ADD operation. The result of dropping became adding a new key/value pair instead: d=# alter foreign data

pgsql: doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example

2023-12-19 Thread Daniel Gustafsson
doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example The example for dropping an option was incorrectly quoting the option key thus making it a value turning the command into an unqualified ADD operation. The result of dropping became adding a new key/value pair instead: d=# alter foreign data

pgsql: doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example

2023-12-19 Thread Daniel Gustafsson
doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example The example for dropping an option was incorrectly quoting the option key thus making it a value turning the command into an unqualified ADD operation. The result of dropping became adding a new key/value pair instead: d=# alter foreign data

pgsql: doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example

2023-12-19 Thread Daniel Gustafsson
doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example The example for dropping an option was incorrectly quoting the option key thus making it a value turning the command into an unqualified ADD operation. The result of dropping became adding a new key/value pair instead: d=# alter foreign data

pgsql: doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example

2023-12-19 Thread Daniel Gustafsson
doc: Fix syntax in ALTER FOREIGN DATA WRAPPER example The example for dropping an option was incorrectly quoting the option key thus making it a value turning the command into an unqualified ADD operation. The result of dropping became adding a new key/value pair instead: d=# alter foreign data

pgsql: Simplify newNode() by removing special cases

2023-12-19 Thread Heikki Linnakangas
Simplify newNode() by removing special cases - Remove MemoryContextAllocZeroAligned(). It was supposed to be a faster version of MemoryContextAllocZero(), but modern compilers turn the MemSetLoop() into a call to memset() anyway, making it more or less identical to MemoryContextAllocZero().

pgsql: pageinspect: Fix failure with hash_bitmap_info() for partitioned

2023-12-19 Thread Michael Paquier
pageinspect: Fix failure with hash_bitmap_info() for partitioned indexes This function reads directly a page from a relation, relying on index_open() to open the index to read from. Unfortunately, this would crash when using partitioned indexes, as these can be opened with index_open() but they h

pgsql: pageinspect: Fix failure with hash_bitmap_info() for partitioned

2023-12-19 Thread Michael Paquier
pageinspect: Fix failure with hash_bitmap_info() for partitioned indexes This function reads directly a page from a relation, relying on index_open() to open the index to read from. Unfortunately, this would crash when using partitioned indexes, as these can be opened with index_open() but they h

pgsql: pageinspect: Fix failure with hash_bitmap_info() for partitioned

2023-12-19 Thread Michael Paquier
pageinspect: Fix failure with hash_bitmap_info() for partitioned indexes This function reads directly a page from a relation, relying on index_open() to open the index to read from. Unfortunately, this would crash when using partitioned indexes, as these can be opened with index_open() but they h

pgsql: pageinspect: Fix failure with hash_bitmap_info() for partitioned

2023-12-19 Thread Michael Paquier
pageinspect: Fix failure with hash_bitmap_info() for partitioned indexes This function reads directly a page from a relation, relying on index_open() to open the index to read from. Unfortunately, this would crash when using partitioned indexes, as these can be opened with index_open() but they h

pgsql: pageinspect: Fix failure with hash_bitmap_info() for partitioned

2023-12-19 Thread Michael Paquier
pageinspect: Fix failure with hash_bitmap_info() for partitioned indexes This function reads directly a page from a relation, relying on index_open() to open the index to read from. Unfortunately, this would crash when using partitioned indexes, as these can be opened with index_open() but they h

pgsql: pageinspect: Fix failure with hash_bitmap_info() for partitioned

2023-12-19 Thread Michael Paquier
pageinspect: Fix failure with hash_bitmap_info() for partitioned indexes This function reads directly a page from a relation, relying on index_open() to open the index to read from. Unfortunately, this would crash when using partitioned indexes, as these can be opened with index_open() but they h