pgsql: Handle XLOG_BTREE_META_CLEANUP in btree_desc() and btree_identif

2018-04-18 Thread Teodor Sigaev
Handle XLOG_BTREE_META_CLEANUP in btree_desc() and btree_identify() New WAL record XLOG_BTREE_META_CLEANUP introduced in 857f9c36 has no handling in btree_desc() and btree_identify(). This patch implements corresponding handling. Alexander Korotkov Branch -- master Details --- https://

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-18 Thread Teodor Sigaev
Another thing that I noticed is that the metapage stores btm_last_cleanup_num_heap_tuples as a float4, even though xl_btree_metadata stores it as a double. I suggest that both places store it as float8, to be consistent. (It should not be double because we always avoid using an

pgsql: Adjust INCLUDE index truncation comments and code.

2018-04-18 Thread Teodor Sigaev
Adjust INCLUDE index truncation comments and code. Add several assertions that ensure that we're dealing with a pivot tuple without non-key attributes where that's expected. Also, remove the assertion within _bt_isequal(), restoring the v10 function signature. A similar check will be performed f

pgsql: Improve error detection/reporting in Catalog.pm and genbki.pl.

2018-04-18 Thread Tom Lane
Improve error detection/reporting in Catalog.pm and genbki.pl. Clean up error messages relating to mistakes in .dat files: make sure they provide the .dat file name and line number, not the place in the Perl script that's reporting the problem. Adopt more uniform message phrasing, too. Make genb

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-18 Thread Alexander Korotkov
On Wed, Apr 18, 2018 at 9:21 PM, Peter Geoghegan wrote: > On Wed, Apr 18, 2018 at 11:12 AM, Fujii Masao > wrote: > > On Thu, Apr 5, 2018 at 1:29 AM, Teodor Sigaev wrote: > >> Skip full index scan during cleanup of B-tree indexes when possible > > > > This commit added XLOG_BTREE_META_CLEANUP, s

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-18 Thread Peter Geoghegan
On Wed, Apr 18, 2018 at 11:12 AM, Fujii Masao wrote: > On Thu, Apr 5, 2018 at 1:29 AM, Teodor Sigaev wrote: >> Skip full index scan during cleanup of B-tree indexes when possible > > This commit added XLOG_BTREE_META_CLEANUP, so btree_desc() and > btree_identify() should be updated so that they h

Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi

2018-04-18 Thread Fujii Masao
On Thu, Apr 5, 2018 at 1:29 AM, Teodor Sigaev wrote: > Skip full index scan during cleanup of B-tree indexes when possible This commit added XLOG_BTREE_META_CLEANUP, so btree_desc() and btree_identify() should be updated so that they handle XLOG_BTREE_META_CLEANUP. But ISTM that you forgot doing

pgsql: Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.

2018-04-18 Thread Tom Lane
Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY. Commit 54eff5311 did not account for the possibility that we'd have a transaction snapshot due to default_transaction_isolation being set high enough to require one. The transaction snapshot is enough to hold back our advertised xmin an

pgsql: Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.

2018-04-18 Thread Tom Lane
Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY. Commit 54eff5311 did not account for the possibility that we'd have a transaction snapshot due to default_transaction_isolation being set high enough to require one. The transaction snapshot is enough to hold back our advertised xmin an

pgsql: Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.

2018-04-18 Thread Tom Lane
Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY. Commit 54eff5311 did not account for the possibility that we'd have a transaction snapshot due to default_transaction_isolation being set high enough to require one. The transaction snapshot is enough to hold back our advertised xmin an

pgsql: Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.

2018-04-18 Thread Tom Lane
Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY. Commit 54eff5311 did not account for the possibility that we'd have a transaction snapshot due to default_transaction_isolation being set high enough to require one. The transaction snapshot is enough to hold back our advertised xmin an

pgsql: Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY.

2018-04-18 Thread Tom Lane
Better fix for deadlock hazard in CREATE INDEX CONCURRENTLY. Commit 54eff5311 did not account for the possibility that we'd have a transaction snapshot due to default_transaction_isolation being set high enough to require one. The transaction snapshot is enough to hold back our advertised xmin an

pgsql: Revert "Add more temporary debug logging, in 9.4 branch only."

2018-04-18 Thread Tom Lane
Revert "Add more temporary debug logging, in 9.4 branch only." This reverts commit eef1a609adfd0c41361aac2e04020bd199fb61fb. It's served its purpose. Branch -- REL9_4_STABLE Details --- https://git.postgresql.org/pg/commitdiff/248c268d5b9fce1c2bb3d8fc28634f4977b613b5 Modified Files

pgsql: Revert "Add temporary debug logging, in 9.4 branch only."

2018-04-18 Thread Tom Lane
Revert "Add temporary debug logging, in 9.4 branch only." This reverts commit e55380f3b60108d402f64131fe655b0e5ccc1f31. It's served its purpose. Branch -- REL9_4_STABLE Details --- https://git.postgresql.org/pg/commitdiff/92b503c48d9d98657c59fe630f44b80efaab87de Modified Files -

pgsql: Improve docs for the new INCLUDE directive in CREATE/ALTER TABLE

2018-04-18 Thread Heikki Linnakangas
Improve docs for the new INCLUDE directive in CREATE/ALTER TABLE. Author: Michael Paquier Discussion: https://www.postgresql.org/message-id/20180411082020.GD19732%40paquier.xyz Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fe7fc52645678ecb661fde47fe5937b48093f79e