pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_17_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_14_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- master Details --- https://git.postgresql.org/pg/commi

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_13_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_16_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_15_STABLE Details --- https://git.postgresql.org/p

pgsql: Remove NULL dereference from RenameRelationInternal().

2024-09-29 Thread Noah Misch
Remove NULL dereference from RenameRelationInternal(). Defect in last week's commit aac2c9b4fde889d13f859c233c2523345e72d32b, per Coverity. Reaching this would need catalog corruption. Back-patch to v12, like that commit. Branch -- REL_12_STABLE Details --- https://git.postgresql.org/p

pgsql: Avoid 037_invalid_database.pl hang under debug_discard_caches.

2024-09-27 Thread Noah Misch
Avoid 037_invalid_database.pl hang under debug_discard_caches. Back-patch to v12 (all supported versions). Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/91e5add02ba98ab3d46db6d3b457d6fd084f1ae3 Modified Files -- src/test/recovery/t/037_invalid_

pgsql: Avoid 037_invalid_database.pl hang under debug_discard_caches.

2024-09-27 Thread Noah Misch
Avoid 037_invalid_database.pl hang under debug_discard_caches. Back-patch to v12 (all supported versions). Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7f90b727422bde6308fd22b7fb0aef48255fd6db Modified Files -- src/test/recovery/t/037_invalid_

pgsql: Avoid 037_invalid_database.pl hang under debug_discard_caches.

2024-09-27 Thread Noah Misch
Avoid 037_invalid_database.pl hang under debug_discard_caches. Back-patch to v12 (all supported versions). Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/4aad471688993d3f6cfb8afa8b3af52b2fbdc7a3 Modified Files -- src/test/recovery/t/037_invalid_

pgsql: Avoid 037_invalid_database.pl hang under debug_discard_caches.

2024-09-27 Thread Noah Misch
Avoid 037_invalid_database.pl hang under debug_discard_caches. Back-patch to v12 (all supported versions). Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0c827fbdb81ad873921c3fae4d973151d8a00785 Modified Files -- src/test/recovery/t/037_invalid_

pgsql: Avoid 037_invalid_database.pl hang under debug_discard_caches.

2024-09-27 Thread Noah Misch
Avoid 037_invalid_database.pl hang under debug_discard_caches. Back-patch to v12 (all supported versions). Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c1ff2d8bc5be55e302731a16aaff563b7f03ed7c Modified Files -- src/test/recovery/t/037_invalid_databas

pgsql: Avoid 037_invalid_database.pl hang under debug_discard_caches.

2024-09-27 Thread Noah Misch
Avoid 037_invalid_database.pl hang under debug_discard_caches. Back-patch to v12 (all supported versions). Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0a709c456fc97b6d5452fe2117afc9a4c3b09da9 Modified Files -- src/test/recovery/t/037_invalid_

pgsql: Avoid 037_invalid_database.pl hang under debug_discard_caches.

2024-09-27 Thread Noah Misch
Avoid 037_invalid_database.pl hang under debug_discard_caches. Back-patch to v12 (all supported versions). Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/118dfd12138fe1eb57c0720d1d67bd17500eca31 Modified Files -- src/test/recovery/t/037_invalid_

pgsql: Fix use of uninitialized value in previous commit.

2024-09-24 Thread Noah Misch
Fix use of uninitialized value in previous commit. Per buildfarm member akepa and others. Back-patch to v16 and v15. Discussion: https://postgr.es/m/20240924224352.93.nmi...@google.com Branch -- REL_16_STABLE Details --- https://git.postgresql.org/pg/commitdiff/90f5412a9a513f2d8e4fee11

pgsql: Fix use of uninitialized value in previous commit.

2024-09-24 Thread Noah Misch
Fix use of uninitialized value in previous commit. Per buildfarm member akepa and others. Back-patch to v16 and v15. Discussion: https://postgr.es/m/20240924224352.93.nmi...@google.com Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0cf3d41cbb425c142ca7b3f1

pgsql: Fix data loss at inplace update after heap_update().

2024-09-24 Thread Noah Misch
Fix data loss at inplace update after heap_update(). As previously-added tests demonstrated, heap_inplace_update() could instead update an unrelated tuple of the same catalog. It could lose the update. Losing relhasindex=t was a source of index corruption. Inplace-updating commands like VACUUM w

pgsql: Fix data loss at inplace update after heap_update().

2024-09-24 Thread Noah Misch
Fix data loss at inplace update after heap_update(). As previously-added tests demonstrated, heap_inplace_update() could instead update an unrelated tuple of the same catalog. It could lose the update. Losing relhasindex=t was a source of index corruption. Inplace-updating commands like VACUUM w

pgsql: Fix data loss at inplace update after heap_update().

2024-09-24 Thread Noah Misch
Fix data loss at inplace update after heap_update(). As previously-added tests demonstrated, heap_inplace_update() could instead update an unrelated tuple of the same catalog. It could lose the update. Losing relhasindex=t was a source of index corruption. Inplace-updating commands like VACUUM w

pgsql: Fix data loss at inplace update after heap_update().

2024-09-24 Thread Noah Misch
Fix data loss at inplace update after heap_update(). As previously-added tests demonstrated, heap_inplace_update() could instead update an unrelated tuple of the same catalog. It could lose the update. Losing relhasindex=t was a source of index corruption. Inplace-updating commands like VACUUM w

pgsql: For inplace update durability, make heap_update() callers wait.

2024-09-24 Thread Noah Misch
For inplace update durability, make heap_update() callers wait. The previous commit fixed some ways of losing an inplace update. It remained possible to lose one when a backend working toward a heap_update() copied a tuple into memory just before inplace update of that tuple. In catalogs eligibl

pgsql: Back-patch "Refactor code in tablecmds.c to check and process ta

2024-09-24 Thread Noah Misch
Back-patch "Refactor code in tablecmds.c to check and process tablespace moves" Back-patch commits 4c9c359d38ff1e2de388eedd860785be6a49201c and 24843297a96d7be16cc3f4b090aacfc6e5e6839e to v13 and v12. Before those commits, we held the modifiable copy of the relation's pg_class row throughout a ta

pgsql: Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.

2024-09-24 Thread Noah Misch
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions. The current use always releases this locktag. A planned use will continue that intent. It will involve more areas of code, making unlock omissions easier. Warn under debug_assertions, like we do for various resource leaks. Back-p

pgsql: For inplace update durability, make heap_update() callers wait.

2024-09-24 Thread Noah Misch
For inplace update durability, make heap_update() callers wait. The previous commit fixed some ways of losing an inplace update. It remained possible to lose one when a backend working toward a heap_update() copied a tuple into memory just before inplace update of that tuple. In catalogs eligibl

pgsql: For inplace update durability, make heap_update() callers wait.

2024-09-24 Thread Noah Misch
For inplace update durability, make heap_update() callers wait. The previous commit fixed some ways of losing an inplace update. It remained possible to lose one when a backend working toward a heap_update() copied a tuple into memory just before inplace update of that tuple. In catalogs eligibl

pgsql: Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.

2024-09-24 Thread Noah Misch
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions. The current use always releases this locktag. A planned use will continue that intent. It will involve more areas of code, making unlock omissions easier. Warn under debug_assertions, like we do for various resource leaks. Back-p

pgsql: For inplace update durability, make heap_update() callers wait.

2024-09-24 Thread Noah Misch
For inplace update durability, make heap_update() callers wait. The previous commit fixed some ways of losing an inplace update. It remained possible to lose one when a backend working toward a heap_update() copied a tuple into memory just before inplace update of that tuple. In catalogs eligibl

pgsql: Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.

2024-09-24 Thread Noah Misch
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions. The current use always releases this locktag. A planned use will continue that intent. It will involve more areas of code, making unlock omissions easier. Warn under debug_assertions, like we do for various resource leaks. Back-p

pgsql: Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.

2024-09-24 Thread Noah Misch
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions. The current use always releases this locktag. A planned use will continue that intent. It will involve more areas of code, making unlock omissions easier. Warn under debug_assertions, like we do for various resource leaks. Back-p

pgsql: Fix data loss at inplace update after heap_update().

2024-09-24 Thread Noah Misch
Fix data loss at inplace update after heap_update(). As previously-added tests demonstrated, heap_inplace_update() could instead update an unrelated tuple of the same catalog. It could lose the update. Losing relhasindex=t was a source of index corruption. Inplace-updating commands like VACUUM w

pgsql: For inplace update durability, make heap_update() callers wait.

2024-09-24 Thread Noah Misch
For inplace update durability, make heap_update() callers wait. The previous commit fixed some ways of losing an inplace update. It remained possible to lose one when a backend working toward a heap_update() copied a tuple into memory just before inplace update of that tuple. In catalogs eligibl

pgsql: For inplace update durability, make heap_update() callers wait.

2024-09-24 Thread Noah Misch
For inplace update durability, make heap_update() callers wait. The previous commit fixed some ways of losing an inplace update. It remained possible to lose one when a backend working toward a heap_update() copied a tuple into memory just before inplace update of that tuple. In catalogs eligibl

pgsql: Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.

2024-09-24 Thread Noah Misch
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions. The current use always releases this locktag. A planned use will continue that intent. It will involve more areas of code, making unlock omissions easier. Warn under debug_assertions, like we do for various resource leaks. Back-p

pgsql: Fix data loss at inplace update after heap_update().

2024-09-24 Thread Noah Misch
Fix data loss at inplace update after heap_update(). As previously-added tests demonstrated, heap_inplace_update() could instead update an unrelated tuple of the same catalog. It could lose the update. Losing relhasindex=t was a source of index corruption. Inplace-updating commands like VACUUM w

pgsql: Fix data loss at inplace update after heap_update().

2024-09-24 Thread Noah Misch
Fix data loss at inplace update after heap_update(). As previously-added tests demonstrated, heap_inplace_update() could instead update an unrelated tuple of the same catalog. It could lose the update. Losing relhasindex=t was a source of index corruption. Inplace-updating commands like VACUUM w

pgsql: For inplace update durability, make heap_update() callers wait.

2024-09-24 Thread Noah Misch
For inplace update durability, make heap_update() callers wait. The previous commit fixed some ways of losing an inplace update. It remained possible to lose one when a backend working toward a heap_update() copied a tuple into memory just before inplace update of that tuple. In catalogs eligibl

pgsql: Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.

2024-09-24 Thread Noah Misch
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions. The current use always releases this locktag. A planned use will continue that intent. It will involve more areas of code, making unlock omissions easier. Warn under debug_assertions, like we do for various resource leaks. Back-p

pgsql: Back-patch "Refactor code in tablecmds.c to check and process ta

2024-09-24 Thread Noah Misch
Back-patch "Refactor code in tablecmds.c to check and process tablespace moves" Back-patch commits 4c9c359d38ff1e2de388eedd860785be6a49201c and 24843297a96d7be16cc3f4b090aacfc6e5e6839e to v13 and v12. Before those commits, we held the modifiable copy of the relation's pg_class row throughout a ta

pgsql: Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.

2024-09-24 Thread Noah Misch
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions. The current use always releases this locktag. A planned use will continue that intent. It will involve more areas of code, making unlock omissions easier. Warn under debug_assertions, like we do for various resource leaks. Back-p

pgsql: Don't enter parallel mode when holding interrupts.

2024-09-17 Thread Noah Misch
Don't enter parallel mode when holding interrupts. Doing so caused the leader to hang in wait_event=ParallelFinish, which required an immediate shutdown to resolve. Back-patch to v12 (all supported versions). Francesco Degrassi Discussion: https://postgr.es/m/CAC-SaSzHUKT=vzj8mpxydc_urpfax+yoa

pgsql: Don't enter parallel mode when holding interrupts.

2024-09-17 Thread Noah Misch
Don't enter parallel mode when holding interrupts. Doing so caused the leader to hang in wait_event=ParallelFinish, which required an immediate shutdown to resolve. Back-patch to v12 (all supported versions). Francesco Degrassi Discussion: https://postgr.es/m/CAC-SaSzHUKT=vzj8mpxydc_urpfax+yoa

pgsql: Don't enter parallel mode when holding interrupts.

2024-09-17 Thread Noah Misch
Don't enter parallel mode when holding interrupts. Doing so caused the leader to hang in wait_event=ParallelFinish, which required an immediate shutdown to resolve. Back-patch to v12 (all supported versions). Francesco Degrassi Discussion: https://postgr.es/m/CAC-SaSzHUKT=vzj8mpxydc_urpfax+yoa

pgsql: Don't enter parallel mode when holding interrupts.

2024-09-17 Thread Noah Misch
Don't enter parallel mode when holding interrupts. Doing so caused the leader to hang in wait_event=ParallelFinish, which required an immediate shutdown to resolve. Back-patch to v12 (all supported versions). Francesco Degrassi Discussion: https://postgr.es/m/CAC-SaSzHUKT=vzj8mpxydc_urpfax+yoa

pgsql: Don't enter parallel mode when holding interrupts.

2024-09-17 Thread Noah Misch
Don't enter parallel mode when holding interrupts. Doing so caused the leader to hang in wait_event=ParallelFinish, which required an immediate shutdown to resolve. Back-patch to v12 (all supported versions). Francesco Degrassi Discussion: https://postgr.es/m/CAC-SaSzHUKT=vzj8mpxydc_urpfax+yoa

pgsql: Don't enter parallel mode when holding interrupts.

2024-09-17 Thread Noah Misch
Don't enter parallel mode when holding interrupts. Doing so caused the leader to hang in wait_event=ParallelFinish, which required an immediate shutdown to resolve. Back-patch to v12 (all supported versions). Francesco Degrassi Discussion: https://postgr.es/m/CAC-SaSzHUKT=vzj8mpxydc_urpfax+yoa

pgsql: Don't enter parallel mode when holding interrupts.

2024-09-17 Thread Noah Misch
Don't enter parallel mode when holding interrupts. Doing so caused the leader to hang in wait_event=ParallelFinish, which required an immediate shutdown to resolve. Back-patch to v12 (all supported versions). Francesco Degrassi Discussion: https://postgr.es/m/CAC-SaSzHUKT=vzj8mpxydc_urpfax+yoa

pgsql: Optimize pg_visibility with read streams.

2024-09-10 Thread Noah Misch
Optimize pg_visibility with read streams. We've measured 5% performance improvement, and this arranges to benefit automatically from future optimizations to the read_stream subsystem. The area lacked test coverage, so close that gap. Nazir Bilal Yavuz Discussion: https://postgr.es/m/can55fz1_ru

pgsql: Revert "Optimize pg_visibility with read streams."

2024-09-04 Thread Noah Misch
Revert "Optimize pg_visibility with read streams." This reverts commit ed1b1ee59fb3792baa32f669333b75024ef01bcc and its followup 1c61fd8b527954f0ec522e5e60a11ce82628b681. They rendered collect_corrupt_items() unable to detect corruption. Discussion: https://postgr.es/m/can55fz1_ru3xpmgtwsu67fth

pgsql: Fix stack variable scope from previous commit.

2024-09-03 Thread Noah Misch
Fix stack variable scope from previous commit. The defect came from me, not from that commit's credited author. Per buildfarm members olingo and grassquit. Discussion: https://postgr.es/m/20240903192030...@rfd.leadboat.com Branch -- master Details --- https://git.postgresql.org/pg/comm

pgsql: Add block_range_read_stream_cb(), to deduplicate code.

2024-09-03 Thread Noah Misch
Add block_range_read_stream_cb(), to deduplicate code. This replaces two functions for iterating over all blocks in a range. A pending patch will use this instead of adding a third. Nazir Bilal Yavuz Discussion: https://postgr.es/m/20240820184742.f2.nmi...@google.com Branch -- master Deta

pgsql: Optimize pg_visibility with read streams.

2024-09-03 Thread Noah Misch
Optimize pg_visibility with read streams. We've measured 5% performance improvement, and this arranges to benefit automatically from future optimizations to the read_stream subsystem. Nazir Bilal Yavuz Discussion: https://postgr.es/m/can55fz1_ru3xpmgtwsu67fth2fs_frrromb7x6zs+f44qbe...@mail.gmai

pgsql: Fix attach of a previously-detached injection point.

2024-08-22 Thread Noah Misch
Fix attach of a previously-detached injection point. It's normal for the name in a free slot to match the new name. The max_inuse mechanism kept simple cases from reaching the problem. The problem could appear when index 0 was the previously-detached entry and index 1 is in use. Back-patch to v

pgsql: Fix attach of a previously-detached injection point.

2024-08-22 Thread Noah Misch
Fix attach of a previously-detached injection point. It's normal for the name in a free slot to match the new name. The max_inuse mechanism kept simple cases from reaching the problem. The problem could appear when index 0 was the previously-detached entry and index 1 is in use. Back-patch to v

pgsql: Fix comments on wal_level=minimal, CREATE TABLESPACE and CREATE

2024-08-18 Thread Noah Misch
Fix comments on wal_level=minimal, CREATE TABLESPACE and CREATE DATABASE. Commit 97ddda8a82ac470ae581d0eb485b6577707678bc removed the rmtree() behavior from XLOG_TBLSPC_CREATE, obsoleting that part of the comment. The comment's point about XLOG_DBASE_CREATE was wrong when commit fa0f466d5329e10b16

pgsql: Teach RPM the package name provided in Perl alias packages.

2024-08-07 Thread Noah Misch
Teach RPM the package name provided in Perl alias packages. When commit 1185be355462d1dc7e2950a7e52eb7ca0cb6f3c8 introduced installation of a file containing "use PostgreSQL::Test::Utils", the RPM Package Manager said "nothing provides perl(PostgreSQL::Test::Utils)". Discussed on pgsql-packagers.

pgsql: Fix names of "Visual Studio" and Meson in a documentation senten

2024-08-07 Thread Noah Misch
Fix names of "Visual Studio" and Meson in a documentation sentence. Commit 3cffe7946c268be91a340ec9a27081cb93d67d35 missed this. Back-patch to v17, which introduced this. Discussion: https://postgr.es/m/caj7c6tm7ct0ejocqalsvyoxxnew4xcufebwj77gktwsqedy...@mail.gmail.com Branch -- REL_17_STA

pgsql: Teach RPM the package name provided in Perl alias packages.

2024-08-07 Thread Noah Misch
Teach RPM the package name provided in Perl alias packages. When commit 1185be355462d1dc7e2950a7e52eb7ca0cb6f3c8 introduced installation of a file containing "use PostgreSQL::Test::Utils", the RPM Package Manager said "nothing provides perl(PostgreSQL::Test::Utils)". Discussed on pgsql-packagers.

pgsql: Fix names of "Visual Studio" and Meson in a documentation senten

2024-08-07 Thread Noah Misch
Fix names of "Visual Studio" and Meson in a documentation sentence. Commit 3cffe7946c268be91a340ec9a27081cb93d67d35 missed this. Back-patch to v17, which introduced this. Discussion: https://postgr.es/m/caj7c6tm7ct0ejocqalsvyoxxnew4xcufebwj77gktwsqedy...@mail.gmail.com Branch -- master De

pgsql: Teach RPM the package name provided in Perl alias packages.

2024-08-07 Thread Noah Misch
Teach RPM the package name provided in Perl alias packages. When commit 1185be355462d1dc7e2950a7e52eb7ca0cb6f3c8 introduced installation of a file containing "use PostgreSQL::Test::Utils", the RPM Package Manager said "nothing provides perl(PostgreSQL::Test::Utils)". Discussed on pgsql-packagers.

pgsql: Fix name of "Visual Studio" in documentation.

2024-08-02 Thread Noah Misch
Fix name of "Visual Studio" in documentation. Back-patch to v17, which introduced this. Aleksander Alekseev Discussion: https://postgr.es/m/caj7c6tm7ct0ejocqalsvyoxxnew4xcufebwj77gktwsqedy...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3cffe794

pgsql: Fix name of "Visual Studio" in documentation.

2024-08-02 Thread Noah Misch
Fix name of "Visual Studio" in documentation. Back-patch to v17, which introduced this. Aleksander Alekseev Discussion: https://postgr.es/m/caj7c6tm7ct0ejocqalsvyoxxnew4xcufebwj77gktwsqedy...@mail.gmail.com Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c

pgsql: Fix private struct field name to match the code using it.

2024-07-23 Thread Noah Misch
Fix private struct field name to match the code using it. Commit 8720a15e9ab121e49174d889eaeafae8ac89de7b added the wrong name. Nazir Bilal Yavuz Discussion: https://postgr.es/m/20240720181405.5a.nmi...@google.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/84

pgsql: Remove "smgr_persistence == 0" dead code.

2024-07-20 Thread Noah Misch
Remove "smgr_persistence == 0" dead code. Reaching that code would have required multiple processes performing relation extension during recovery, which does not happen. That caller has the persistence available, so pass it. This was dead code as soon as commit 210622c60e1a9db2e2730140b8106ab57d

pgsql: Use read streams in CREATE DATABASE when STRATEGY=WAL_LOG.

2024-07-20 Thread Noah Misch
Use read streams in CREATE DATABASE when STRATEGY=WAL_LOG. While this doesn't significantly change runtime now, it arranges for STRATEGY=WAL_LOG to benefit automatically from future optimizations to the read_stream subsystem. For large tables in the template database, this does read 16x as many b

pgsql: Refactor PinBufferForBlock() to remove checks about persistence.

2024-07-20 Thread Noah Misch
Refactor PinBufferForBlock() to remove checks about persistence. There are checks in PinBufferForBlock() function to set persistence of the relation. This function is called for each block in the relation. Instead, set persistence of the relation before PinBufferForBlock(). Nazir Bilal Yavuz Di

pgsql: Add a way to create read stream object by using SMgrRelation.

2024-07-20 Thread Noah Misch
Add a way to create read stream object by using SMgrRelation. Currently read stream object can be created only by using Relation. Nazir Bilal Yavuz Discussion: https://postgr.es/m/CAN55FZ0JKL6vk1xQp6rfOXiNFV1u1H0tJDPPGHWoiO3ea2Wc=a...@mail.gmail.com Branch -- master Details --- https:

pgsql: Fix new assertion for MERGE view_name ... DO NOTHING.

2024-07-13 Thread Noah Misch
Fix new assertion for MERGE view_name ... DO NOTHING. Such queries don't expand automatically updatable views, and ModifyTable uses the wholerow attribute unconditionally. The user-visible behavior is fine, so change to more-specific assertions. Commit d5f788b41dc2cbdde6e7694c70dda54d829a5ed5 ad

pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.

2024-07-13 Thread Noah Misch
Don't lose partitioned table reltuples=0 after relhassubclass=f. ANALYZE sets relhassubclass=f when a partitioned table no longer has partitions. An ANALYZE doing that proceeded to apply the inplace update of pg_class.reltuples to the old pg_class tuple instead of the new tuple, losing that reltu

pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.

2024-07-13 Thread Noah Misch
Don't lose partitioned table reltuples=0 after relhassubclass=f. ANALYZE sets relhassubclass=f when a partitioned table no longer has partitions. An ANALYZE doing that proceeded to apply the inplace update of pg_class.reltuples to the old pg_class tuple instead of the new tuple, losing that reltu

pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.

2024-07-13 Thread Noah Misch
Don't lose partitioned table reltuples=0 after relhassubclass=f. ANALYZE sets relhassubclass=f when a partitioned table no longer has partitions. An ANALYZE doing that proceeded to apply the inplace update of pg_class.reltuples to the old pg_class tuple instead of the new tuple, losing that reltu

pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.

2024-07-13 Thread Noah Misch
Don't lose partitioned table reltuples=0 after relhassubclass=f. ANALYZE sets relhassubclass=f when a partitioned table no longer has partitions. An ANALYZE doing that proceeded to apply the inplace update of pg_class.reltuples to the old pg_class tuple instead of the new tuple, losing that reltu

pgsql: Don't lose partitioned table reltuples=0 after relhassubclass=f.

2024-07-13 Thread Noah Misch
Don't lose partitioned table reltuples=0 after relhassubclass=f. ANALYZE sets relhassubclass=f when a partitioned table no longer has partitions. An ANALYZE doing that proceeded to apply the inplace update of pg_class.reltuples to the old pg_class tuple instead of the new tuple, losing that reltu

pgsql: Fix new assertion for MERGE view_name ... DO NOTHING.

2024-07-13 Thread Noah Misch
Fix new assertion for MERGE view_name ... DO NOTHING. Such queries don't expand automatically updatable views, and ModifyTable uses the wholerow attribute unconditionally. The user-visible behavior is fine, so change to more-specific assertions. Commit d5f788b41dc2cbdde6e7694c70dda54d829a5ed5 ad

pgsql: Fix .gitignore for new injection suite.

2024-06-28 Thread Noah Misch
Fix .gitignore for new injection suite. Commit c35f419d6efbdf1a050250d84b687e6705917711 missed this. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/db0c96cc18aec417101e37e59fcc53d4bf647915 Modified Files -- src/test/modules/injection_points/.gitignore

pgsql: Remove configuration-dependent output from new inplace-inval tes

2024-06-28 Thread Noah Misch
Remove configuration-dependent output from new inplace-inval test. Per buildfarm members prion and trilobite. Back-patch to v12 (all supported versions), like commit 0844b3968985447ed0a6937cfc8639e379da2fe6. Strategy reviewed by Tom Lane. Discussion: https://postgr.es/m/20240628051353.a0.nmi...

pgsql: Remove configuration-dependent output from new inplace-inval tes

2024-06-28 Thread Noah Misch
Remove configuration-dependent output from new inplace-inval test. Per buildfarm members prion and trilobite. Back-patch to v12 (all supported versions), like commit 0844b3968985447ed0a6937cfc8639e379da2fe6. Strategy reviewed by Tom Lane. Discussion: https://postgr.es/m/20240628051353.a0.nmi...

pgsql: Remove configuration-dependent output from new inplace-inval tes

2024-06-28 Thread Noah Misch
Remove configuration-dependent output from new inplace-inval test. Per buildfarm members prion and trilobite. Back-patch to v12 (all supported versions), like commit 0844b3968985447ed0a6937cfc8639e379da2fe6. Strategy reviewed by Tom Lane. Discussion: https://postgr.es/m/20240628051353.a0.nmi...

pgsql: Remove configuration-dependent output from new inplace-inval tes

2024-06-28 Thread Noah Misch
Remove configuration-dependent output from new inplace-inval test. Per buildfarm members prion and trilobite. Back-patch to v12 (all supported versions), like commit 0844b3968985447ed0a6937cfc8639e379da2fe6. Strategy reviewed by Tom Lane. Discussion: https://postgr.es/m/20240628051353.a0.nmi...

pgsql: Remove configuration-dependent output from new inplace-inval tes

2024-06-28 Thread Noah Misch
Remove configuration-dependent output from new inplace-inval test. Per buildfarm members prion and trilobite. Back-patch to v12 (all supported versions), like commit 0844b3968985447ed0a6937cfc8639e379da2fe6. Strategy reviewed by Tom Lane. Discussion: https://postgr.es/m/20240628051353.a0.nmi...

pgsql: Remove configuration-dependent output from new inplace-inval tes

2024-06-28 Thread Noah Misch
Remove configuration-dependent output from new inplace-inval test. Per buildfarm members prion and trilobite. Back-patch to v12 (all supported versions), like commit 0844b3968985447ed0a6937cfc8639e379da2fe6. Strategy reviewed by Tom Lane. Discussion: https://postgr.es/m/20240628051353.a0.nmi...

pgsql: AccessExclusiveLock new relations just after assigning the OID.

2024-06-27 Thread Noah Misch
AccessExclusiveLock new relations just after assigning the OID. This has no user-visible, important consequences, since other sessions' catalog scans can't find the relation until we commit. However, this unblocks introducing a rule about locks required to heap_update() a pg_class row. CREATE TA

pgsql: Cope with inplace update making catcache stale during TOAST fetc

2024-06-27 Thread Noah Misch
Cope with inplace update making catcache stale during TOAST fetch. This extends ad98fb14226ae6456fbaed7990ee7591cbe5efd2 to invals of inplace updates. Trouble requires an inplace update of a catalog having a TOAST table, so only pg_database was at risk. (The other catalog on which core code perf

pgsql: Make TAP todo_start effects the same under Meson and prove_check

2024-06-27 Thread Noah Misch
Make TAP todo_start effects the same under Meson and prove_check. This could have caused spurious failures only on SPARC Linux, because today's only todo_start tests for that platform. Back-patch to v16, where Meson support first appeared. Reviewed by Robert Haas. Discussion: https://postgr.es/

pgsql: Cope with inplace update making catcache stale during TOAST fetc

2024-06-27 Thread Noah Misch
Cope with inplace update making catcache stale during TOAST fetch. This extends ad98fb14226ae6456fbaed7990ee7591cbe5efd2 to invals of inplace updates. Trouble requires an inplace update of a catalog having a TOAST table, so only pg_database was at risk. (The other catalog on which core code perf

pgsql: Lock before setting relhassubclass on RELKIND_PARTITIONED_INDEX.

2024-06-27 Thread Noah Misch
Lock before setting relhassubclass on RELKIND_PARTITIONED_INDEX. Commit 5b562644fec696977df4a82790064e8287927891 added a comment that SetRelationHasSubclass() callers must hold this lock. When commit 17f206fbc824d2b4b14480199ca9ff7dea417eda extended use of this column to partitioned indexes, it d

pgsql: Lock owned sequences during ALTER TABLE SET { LOGGED | UNLOGGED

2024-06-27 Thread Noah Misch
Lock owned sequences during ALTER TABLE SET { LOGGED | UNLOGGED }. These commands already make the persistence of owned sequences follow owned table persistence changes. They didn't lock those sequences. They lost the effect of nextval() calls that other sessions make after the ALTER TABLE comman

pgsql: Improve test coverage for changes to inplace-updated catalogs.

2024-06-27 Thread Noah Misch
Improve test coverage for changes to inplace-updated catalogs. This covers both regular and inplace changes, since bugs arise at their intersection. Where marked, these witness extant bugs. Back-patch to v12 (all supported versions). Reviewed (in an earlier version) by Robert Haas. Discussion:

pgsql: Remove comment about xl_heap_inplace "AT END OF STRUCT".

2024-06-27 Thread Noah Misch
Remove comment about xl_heap_inplace "AT END OF STRUCT". Commit 2c03216d831160bedd72d45f712601b6f7d03f1c moved the tuple data from there to the buffer-0 data. Back-patch to v12 (all supported versions), the plan for the next change to this struct. Discussion: https://postgr.es/m/20240523000548.5

pgsql: Remove comment about xl_heap_inplace "AT END OF STRUCT".

2024-06-27 Thread Noah Misch
Remove comment about xl_heap_inplace "AT END OF STRUCT". Commit 2c03216d831160bedd72d45f712601b6f7d03f1c moved the tuple data from there to the buffer-0 data. Back-patch to v12 (all supported versions), the plan for the next change to this struct. Discussion: https://postgr.es/m/20240523000548.5

pgsql: Cope with inplace update making catcache stale during TOAST fetc

2024-06-27 Thread Noah Misch
Cope with inplace update making catcache stale during TOAST fetch. This extends ad98fb14226ae6456fbaed7990ee7591cbe5efd2 to invals of inplace updates. Trouble requires an inplace update of a catalog having a TOAST table, so only pg_database was at risk. (The other catalog on which core code perf

pgsql: Improve test coverage for changes to inplace-updated catalogs.

2024-06-27 Thread Noah Misch
Improve test coverage for changes to inplace-updated catalogs. This covers both regular and inplace changes, since bugs arise at their intersection. Where marked, these witness extant bugs. Back-patch to v12 (all supported versions). Reviewed (in an earlier version) by Robert Haas. Discussion:

pgsql: Lock before setting relhassubclass on RELKIND_PARTITIONED_INDEX.

2024-06-27 Thread Noah Misch
Lock before setting relhassubclass on RELKIND_PARTITIONED_INDEX. Commit 5b562644fec696977df4a82790064e8287927891 added a comment that SetRelationHasSubclass() callers must hold this lock. When commit 17f206fbc824d2b4b14480199ca9ff7dea417eda extended use of this column to partitioned indexes, it d

pgsql: AccessExclusiveLock new relations just after assigning the OID.

2024-06-27 Thread Noah Misch
AccessExclusiveLock new relations just after assigning the OID. This has no user-visible, important consequences, since other sessions' catalog scans can't find the relation until we commit. However, this unblocks introducing a rule about locks required to heap_update() a pg_class row. CREATE TA

pgsql: Expand comments and add an assertion in nodeModifyTable.c.

2024-06-27 Thread Noah Misch
Expand comments and add an assertion in nodeModifyTable.c. Most comments concern RELKIND_VIEW. One addresses the ExecUpdate() "tupleid" parameter. A later commit will rely on these facts, but they hold already. Back-patch to v12 (all supported versions), the plan for that commit. Reviewed (in

pgsql: Make TAP todo_start effects the same under Meson and prove_check

2024-06-27 Thread Noah Misch
Make TAP todo_start effects the same under Meson and prove_check. This could have caused spurious failures only on SPARC Linux, because today's only todo_start tests for that platform. Back-patch to v16, where Meson support first appeared. Reviewed by Robert Haas. Discussion: https://postgr.es/

pgsql: Expand comments and add an assertion in nodeModifyTable.c.

2024-06-27 Thread Noah Misch
Expand comments and add an assertion in nodeModifyTable.c. Most comments concern RELKIND_VIEW. One addresses the ExecUpdate() "tupleid" parameter. A later commit will rely on these facts, but they hold already. Back-patch to v12 (all supported versions), the plan for that commit. Reviewed (in

pgsql: Expand comments and add an assertion in nodeModifyTable.c.

2024-06-27 Thread Noah Misch
Expand comments and add an assertion in nodeModifyTable.c. Most comments concern RELKIND_VIEW. One addresses the ExecUpdate() "tupleid" parameter. A later commit will rely on these facts, but they hold already. Back-patch to v12 (all supported versions), the plan for that commit. Reviewed (in

pgsql: Lock before setting relhassubclass on RELKIND_PARTITIONED_INDEX.

2024-06-27 Thread Noah Misch
Lock before setting relhassubclass on RELKIND_PARTITIONED_INDEX. Commit 5b562644fec696977df4a82790064e8287927891 added a comment that SetRelationHasSubclass() callers must hold this lock. When commit 17f206fbc824d2b4b14480199ca9ff7dea417eda extended use of this column to partitioned indexes, it d

pgsql: Improve test coverage for changes to inplace-updated catalogs.

2024-06-27 Thread Noah Misch
Improve test coverage for changes to inplace-updated catalogs. This covers both regular and inplace changes, since bugs arise at their intersection. Where marked, these witness extant bugs. Back-patch to v12 (all supported versions). Reviewed (in an earlier version) by Robert Haas. Discussion:

pgsql: AccessExclusiveLock new relations just after assigning the OID.

2024-06-27 Thread Noah Misch
AccessExclusiveLock new relations just after assigning the OID. This has no user-visible, important consequences, since other sessions' catalog scans can't find the relation until we commit. However, this unblocks introducing a rule about locks required to heap_update() a pg_class row. CREATE TA

  1   2   3   4   5   6   7   8   9   10   >