pgsql: Rename the recovery-related wait events.

2020-03-18 Thread Fujii Masao
Rename the recovery-related wait events. This commit renames RecoveryWalAll and RecoveryWalStream wait events to RecoveryWalStream and RecoveryRetrieveRetryInterval, respectively, in order to make the names and what they are more consistent. For example, previously RecoveryWalAll was reported as a

pgsql: Add assert to ensure that page locks don't participate in deadlo

2020-03-18 Thread Amit Kapila
Add assert to ensure that page locks don't participate in deadlock cycle. Assert that we don't acquire any other heavyweight lock while holding the page lock except for relation extension. However, these locks are never taken in reverse order which implies that page locks will never participate i

pgsql: nbtree: Use raw PageAddItem() for retail inserts.

2020-03-18 Thread Peter Geoghegan
nbtree: Use raw PageAddItem() for retail inserts. Only internal page splits need to call _bt_pgaddtup() instead of PageAddItem(), and only for data items, one of which will end up at the first offset (or first offset after the high key offset) on the new right page. This data item alone will need

pgsql: Fix comment related to concurrent index swapping in index.c

2020-03-18 Thread Michael Paquier
Fix comment related to concurrent index swapping in index.c A comment about switching indisvalid of the new and old indexes swapped in REINDEX CONCURRENTLY got this backwards. Issue introduced by 5dc92b8, the original commit of REINDEX CONCURRENTLY. Author: Julien Rouhaud Discussion: https://pos

pgsql: Fix comment related to concurrent index swapping in index.c

2020-03-18 Thread Michael Paquier
Fix comment related to concurrent index swapping in index.c A comment about switching indisvalid of the new and old indexes swapped in REINDEX CONCURRENTLY got this backwards. Issue introduced by 5dc92b8, the original commit of REINDEX CONCURRENTLY. Author: Julien Rouhaud Discussion: https://pos

pgsql: Disk-based Hash Aggregation.

2020-03-18 Thread Jeff Davis
Disk-based Hash Aggregation. While performing hash aggregation, track memory usage when adding new groups to a hash table. If the memory usage exceeds work_mem, enter "spill mode". In spill mode, new groups are not created in the hash table(s), but existing groups continue to be advanced if input

pgsql: Specialize MemoryContextMemAllocated().

2020-03-18 Thread Jeff Davis
Specialize MemoryContextMemAllocated(). An AllocSet doubles the size of allocated blocks (up to maxBlockSize), which means that the current block can represent half of the total allocated space for the memory context. But the free space in the current block may never have been touched, so don't co

pgsql: Enable BEFORE row-level triggers for partitioned tables

2020-03-18 Thread Alvaro Herrera
Enable BEFORE row-level triggers for partitioned tables ... with the limitation that the tuple must remain in the same partition. Reviewed-by: Ashutosh Bapat Discussion: https://postgr.es/m/20200227165158.GA2071@alvherre.pgsql Branch -- master Details --- https://git.postgresql.org/pg/c

pgsql: Refactor nbtree fastpath optimization.

2020-03-18 Thread Peter Geoghegan
Refactor nbtree fastpath optimization. Commit 2b272734, which added the fastpath rightmost leaf page cache insert optimization, added code to _bt_doinsert() to handle using and invalidating the backend local block cache. It doesn't seem like a good place to handle these low level details, though.

pgsql: Implement type regcollation

2020-03-18 Thread Peter Eisentraut
Implement type regcollation This will be helpful for a following commit and it's also just generally useful, like the other reg* types. Author: Julien Rouhaud Reviewed-by: Thomas Munro and Michael Paquier Discussion: https://postgr.es/m/CAEepm%3D0uEQCpfq_%2BLYFBdArCe4Ot98t1aR4eYiYTe%3DyavQygiQ%4

pgsql: Document pg_statistic_ext.stxstattarget

2020-03-18 Thread Tomas Vondra
Document pg_statistic_ext.stxstattarget Commit d06215d03b added a new attribute to pg_statistic_ext catalog, but failed to add it to document it properly. Reported-by: Noriyoshi Shinoda Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c31132d87c6315bbbe4b4aa383705a

pgsql: Recognize some OR clauses as compatible with functional dependen

2020-03-18 Thread Tomas Vondra
Recognize some OR clauses as compatible with functional dependencies Since commit 8f321bd16c functional dependencies can handle IN clauses, which however introduced a possible (and surprising) inconsistency, because IN clauses may be expressed as an OR clause, which are still considered incompatib

pgsql: Doc: remove reference to nonexisting GUC from 9.5 release notes.

2020-03-18 Thread Tom Lane
Doc: remove reference to nonexisting GUC from 9.5 release notes. idle_in_transaction_session_timeout doesn't exist before 9.6, so mentioning it in older branches' release notes is confusing. Lazy copy-and-paste on my (tgl's) part. Too late to do anything about 9.4, but we can usefully fix this in

pgsql: Correct the descriptions of recovery-related wait events in docs

2020-03-18 Thread Fujii Masao
Correct the descriptions of recovery-related wait events in docs. This commit corrects the descriptions of RecoveryWalAll and RecoveryWalStream wait events in the documentation. Back-patch to v10 where those wait events were added. Author: Fujii Masao Reviewed-by: Kyotaro Horiguchi, Atsushi Tori

pgsql: Correct the descriptions of recovery-related wait events in docs

2020-03-18 Thread Fujii Masao
Correct the descriptions of recovery-related wait events in docs. This commit corrects the descriptions of RecoveryWalAll and RecoveryWalStream wait events in the documentation. Back-patch to v10 where those wait events were added. Author: Fujii Masao Reviewed-by: Kyotaro Horiguchi, Atsushi Tori

pgsql: Correct the descriptions of recovery-related wait events in docs

2020-03-18 Thread Fujii Masao
Correct the descriptions of recovery-related wait events in docs. This commit corrects the descriptions of RecoveryWalAll and RecoveryWalStream wait events in the documentation. Back-patch to v10 where those wait events were added. Author: Fujii Masao Reviewed-by: Kyotaro Horiguchi, Atsushi Tori

pgsql: Correct the descriptions of recovery-related wait events in docs

2020-03-18 Thread Fujii Masao
Correct the descriptions of recovery-related wait events in docs. This commit corrects the descriptions of RecoveryWalAll and RecoveryWalStream wait events in the documentation. Back-patch to v10 where those wait events were added. Author: Fujii Masao Reviewed-by: Kyotaro Horiguchi, Atsushi Tori

pgsql: doc: Update documentation about reg* types

2020-03-18 Thread Peter Eisentraut
doc: Update documentation about reg* types Add missing index entries, add missing information on pg_upgrade man page, order things alphabetical instead of (apparently) in the order they were implemented, reduce repetitiveness a bit. Branch -- master Details --- https://git.postgresql.org

pgsql: Fix wording of several extended stats comments

2020-03-18 Thread Tomas Vondra
Fix wording of several extended stats comments Reported-by: Thomas Munro Discussion: https://www.postgresql.org/message-id/flat/20200113230008.g67iyk4cs3xbnjju@development Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6f72dbc48bf8a0f4dc3248691355b0688d7aeba2 Mod

pgsql: Update the description of type of check_option reloption in docs

2020-03-18 Thread Fujii Masao
Update the description of type of check_option reloption in docs. Commit 773df883e8f7 changed the type of check_option reloption from string to enum. But it forgot to update the description of the type in the documentation. Author: Atsushi Torikoshi Discussion: https://postgr.es/m/CACZ0uYFvHF4n6