pgsql: Change overly strict Assert in TransactionGroupUpdateXidStatus.

2019-12-16 Thread Amit Kapila
Change overly strict Assert in TransactionGroupUpdateXidStatus. This Assert thought that an overflowed transaction can never get registered for the group update.  But that is not true, because even when the number of children for a transaction got reduced, the overflow flag is not changed. And, f

pgsql: Change overly strict Assert in TransactionGroupUpdateXidStatus.

2019-12-16 Thread Amit Kapila
Change overly strict Assert in TransactionGroupUpdateXidStatus. This Assert thought that an overflowed transaction can never get registered for the group update.  But that is not true, because even when the number of children for a transaction got reduced, the overflow flag is not changed. And, f

pgsql: Change overly strict Assert in TransactionGroupUpdateXidStatus.

2019-12-16 Thread Amit Kapila
Change overly strict Assert in TransactionGroupUpdateXidStatus. This Assert thought that an overflowed transaction can never get registered for the group update.  But that is not true, because even when the number of children for a transaction got reduced, the overflow flag is not changed. And, f

pgsql: Rename nbtree tuple macros.

2019-12-16 Thread Peter Geoghegan
Rename nbtree tuple macros. Rename two function-style macros, removing the word "inner". This makes things more consistent. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fcf3b6917bd8f6f9f463e3e42e53d6ff9612e327 Modified Files -- contrib/amcheck/verif

pgsql: Fix query cancellation handling in psql

2019-12-16 Thread Michael Paquier
Fix query cancellation handling in psql The refactoring done in a4fd3aa for query cancellation has messed up with the logic in psql by mixing CancelRequested and cancel_pressed, breaking for example \watch. The former would be switched to true if a cancellation request has been attempted and that

pgsql: Fix "force_parallel_mode = regress" to work with ANALYZE + VERBO

2019-12-16 Thread Tom Lane
Fix "force_parallel_mode = regress" to work with ANALYZE + VERBOSE. force_parallel_mode = regress is supposed to force use of a Gather node without having any impact on EXPLAIN output. But it failed to accomplish that if both ANALYZE and VERBOSE are given, because that enables per-worker output d

pgsql: Update nbtree README's "Scans during Recovery".

2019-12-16 Thread Peter Geoghegan
Update nbtree README's "Scans during Recovery". get_actual_variable_range() hasn't used a dirty snapshot since commit 3ca930fc3, which invented a new snapshot type specifically to meet selfuncs.c's requirements (HeapTupleSatisfiesNonVacuumable() type snapshots were added). Discussion: https://po

pgsql: On Windows, wait a little to see if ERROR_ACCESS_DENIED goes awa

2019-12-16 Thread Tom Lane
On Windows, wait a little to see if ERROR_ACCESS_DENIED goes away. Attempting to open a file fails with ERROR_ACCESS_DENIED if the file is flagged for deletion but not yet actually gone (another in a long list of reasons why Windows is broken, if you ask me). This seems likely to explain a lot of

pgsql: On Windows, wait a little to see if ERROR_ACCESS_DENIED goes awa

2019-12-16 Thread Tom Lane
On Windows, wait a little to see if ERROR_ACCESS_DENIED goes away. Attempting to open a file fails with ERROR_ACCESS_DENIED if the file is flagged for deletion but not yet actually gone (another in a long list of reasons why Windows is broken, if you ask me). This seems likely to explain a lot of

pgsql: On Windows, wait a little to see if ERROR_ACCESS_DENIED goes awa

2019-12-16 Thread Tom Lane
On Windows, wait a little to see if ERROR_ACCESS_DENIED goes away. Attempting to open a file fails with ERROR_ACCESS_DENIED if the file is flagged for deletion but not yet actually gone (another in a long list of reasons why Windows is broken, if you ask me). This seems likely to explain a lot of

pgsql: On Windows, wait a little to see if ERROR_ACCESS_DENIED goes awa

2019-12-16 Thread Tom Lane
On Windows, wait a little to see if ERROR_ACCESS_DENIED goes away. Attempting to open a file fails with ERROR_ACCESS_DENIED if the file is flagged for deletion but not yet actually gone (another in a long list of reasons why Windows is broken, if you ask me). This seems likely to explain a lot of

pgsql: On Windows, wait a little to see if ERROR_ACCESS_DENIED goes awa

2019-12-16 Thread Tom Lane
On Windows, wait a little to see if ERROR_ACCESS_DENIED goes away. Attempting to open a file fails with ERROR_ACCESS_DENIED if the file is flagged for deletion but not yet actually gone (another in a long list of reasons why Windows is broken, if you ask me). This seems likely to explain a lot of

pgsql: On Windows, wait a little to see if ERROR_ACCESS_DENIED goes awa

2019-12-16 Thread Tom Lane
On Windows, wait a little to see if ERROR_ACCESS_DENIED goes away. Attempting to open a file fails with ERROR_ACCESS_DENIED if the file is flagged for deletion but not yet actually gone (another in a long list of reasons why Windows is broken, if you ask me). This seems likely to explain a lot of

pgsql: On Windows, wait a little to see if ERROR_ACCESS_DENIED goes awa

2019-12-16 Thread Tom Lane
On Windows, wait a little to see if ERROR_ACCESS_DENIED goes away. Attempting to open a file fails with ERROR_ACCESS_DENIED if the file is flagged for deletion but not yet actually gone (another in a long list of reasons why Windows is broken, if you ask me). This seems likely to explain a lot of

pgsql: Demote variable from global to local

2019-12-16 Thread Alvaro Herrera
Demote variable from global to local recoveryDelayUntilTime was introduced by commit 36da3cfb457b as a global because its method of operation was devilishly intrincate. Commit c945af80cfda removed all that complexity and could have turned it into a local variable, but didn't. Do so now. Discuss

pgsql: Fix yet another crash in page split during GiST index creation.

2019-12-16 Thread Heikki Linnakangas
Fix yet another crash in page split during GiST index creation. Commit a7ee7c8513 fixed a bug in GiST page split during index creation, where we failed to re-find the position of a downlink after the page containing it was split. However, that fix was incomplete; the other call to gistinserttuples

pgsql: Fix yet another crash in page split during GiST index creation.

2019-12-16 Thread Heikki Linnakangas
Fix yet another crash in page split during GiST index creation. Commit a7ee7c8513 fixed a bug in GiST page split during index creation, where we failed to re-find the position of a downlink after the page containing it was split. However, that fix was incomplete; the other call to gistinserttuples

pgsql: Fix build of Perl-using modules of Windows

2019-12-16 Thread Peter Eisentraut
Fix build of Perl-using modules of Windows Commit f14413b684d57211068ee56ee04695efcc87a23a broke the build of Perl-using modules on Windows. Perl might have its own definitions of uid_t and gid_t, so we hide ours, but then we can't use ours in our header files such as port.h which don't see the P

pgsql: Sort out getpeereid() and peer auth handling on Windows

2019-12-16 Thread Peter Eisentraut
Sort out getpeereid() and peer auth handling on Windows The getpeereid() uses have so far been protected by HAVE_UNIX_SOCKETS, so they didn't ever care about Windows support. But in anticipation of Unix-domain socket support on Windows, that needs to be handled differently. Windows doesn't suppo

pgsql: Clean up some misplaced comments in partition_join.sql regressio

2019-12-16 Thread Etsuro Fujita
Clean up some misplaced comments in partition_join.sql regression test. Also, add a comment explaining a test case. Back-patch to 11 where the regression test was added. Discussion: https://postgr.es/m/CAPmGK15adZPh2B%2BmGUjSOMH%2BH39ogDRWfCfm4G6jncZCAs9V_Q%40mail.gmail.com Branch -- REL_1

pgsql: Clean up some misplaced comments in partition_join.sql regressio

2019-12-16 Thread Etsuro Fujita
Clean up some misplaced comments in partition_join.sql regression test. Also, add a comment explaining a test case. Back-patch to 11 where the regression test was added. Discussion: https://postgr.es/m/CAPmGK15adZPh2B%2BmGUjSOMH%2BH39ogDRWfCfm4G6jncZCAs9V_Q%40mail.gmail.com Branch -- REL_1

pgsql: Clean up some misplaced comments in partition_join.sql regressio

2019-12-16 Thread Etsuro Fujita
Clean up some misplaced comments in partition_join.sql regression test. Also, add a comment explaining a test case. Back-patch to 11 where the regression test was added. Discussion: https://postgr.es/m/CAPmGK15adZPh2B%2BmGUjSOMH%2BH39ogDRWfCfm4G6jncZCAs9V_Q%40mail.gmail.com Branch -- maste