pgsql: Fix msvc builds for ActivePerl > 5.24

2018-03-02 Thread Magnus Hagander
Fix msvc builds for ActivePerl > 5.24 From this version ActivePerl ships both a .lib and a .a file for the perl library, which our code would detect as there being no library available. Instead, we should pick the .lib version and use that. Report and suggested fix in bug #15065 Author: Heath Lo

pgsql: Make gistvacuumcleanup() count the actual number of index tuples

2018-03-02 Thread Tom Lane
Make gistvacuumcleanup() count the actual number of index tuples. Previously, it just returned the heap tuple count, which might be only an estimate, and would be completely the wrong thing if the index is partial. Since this function scans every index page anyway to find free pages, it's practica

pgsql: Make gistvacuumcleanup() count the actual number of index tuples

2018-03-02 Thread Tom Lane
Make gistvacuumcleanup() count the actual number of index tuples. Previously, it just returned the heap tuple count, which might be only an estimate, and would be completely the wrong thing if the index is partial. Since this function scans every index page anyway to find free pages, it's practica

pgsql: Make gistvacuumcleanup() count the actual number of index tuples

2018-03-02 Thread Tom Lane
Make gistvacuumcleanup() count the actual number of index tuples. Previously, it just returned the heap tuple count, which might be only an estimate, and would be completely the wrong thing if the index is partial. Since this function scans every index page anyway to find free pages, it's practica

pgsql: Make gistvacuumcleanup() count the actual number of index tuples

2018-03-02 Thread Tom Lane
Make gistvacuumcleanup() count the actual number of index tuples. Previously, it just returned the heap tuple count, which might be only an estimate, and would be completely the wrong thing if the index is partial. Since this function scans every index page anyway to find free pages, it's practica

pgsql: Make gistvacuumcleanup() count the actual number of index tuples

2018-03-02 Thread Tom Lane
Make gistvacuumcleanup() count the actual number of index tuples. Previously, it just returned the heap tuple count, which might be only an estimate, and would be completely the wrong thing if the index is partial. Since this function scans every index page anyway to find free pages, it's practica

pgsql: Make gistvacuumcleanup() count the actual number of index tuples

2018-03-02 Thread Tom Lane
Make gistvacuumcleanup() count the actual number of index tuples. Previously, it just returned the heap tuple count, which might be only an estimate, and would be completely the wrong thing if the index is partial. Since this function scans every index page anyway to find free pages, it's practica

pgsql: Improve tab-completion for ALTER INDEX RESET/SET.

2018-03-02 Thread Fujii Masao
Improve tab-completion for ALTER INDEX RESET/SET. Author: Masahiko Sawada Discussion: https://postgr.es/m/CAD21AoDSGfB0G4egOy2UvBT=uihojuh-syxgsipj+xnkpwd...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2b8c94e1b4a86907fceef87840c32d3703f7e161 Mo

pgsql: shm_mq: Reduce spinlock usage.

2018-03-02 Thread Robert Haas
shm_mq: Reduce spinlock usage. Previously, mq_bytes_read and mq_bytes_written were protected by the spinlock, but that turns out to cause pretty serious spinlock contention on queries which send many tuples through a Gather or Gather Merge node. This patches changes things so that we instead read

pgsql: shm_mq: Have the receiver set the sender's less frequently.

2018-03-02 Thread Robert Haas
shm_mq: Have the receiver set the sender's less frequently. Instead of marking data from the ringer buffer consumed and setting the sender's latch for every message, do it only when the amount of data we can consume is at least 1/4 of the size of the ring buffer, or when no data remains in the rin

pgsql: postgres_fdw: Fourth attempt to stabilize regression tests.

2018-03-02 Thread Robert Haas
postgres_fdw: Fourth attempt to stabilize regression tests. Commit 1bc0100d270e5bcc980a0629b8726a32a497e788 added this test, and commits 882ea509fe7a4711fe25463427a33262b873dfa1, 958e20e42d6c346ab89f6c72e4262230161d1663, 4fa396464e5fe238b7994535182f28318c61c78e tried to stabilize it. It's still n

pgsql: Add prokind column, replacing proisagg and proiswindow

2018-03-02 Thread Peter Eisentraut
Add prokind column, replacing proisagg and proiswindow The new column distinguishes normal functions, procedures, aggregates, and window functions. This replaces the existing columns proisagg and proiswindow, and replaces the convention that procedures are indicated by prorettype == 0. Also chan

pgsql: Fix pgbench TAP test to work in VPATH builds.

2018-03-02 Thread Tom Lane
Fix pgbench TAP test to work in VPATH builds. Previously, it'd try to create log files under the source directory not the build directory. This fell over if the source isn't writable by the building user. Fabien Coelho Discussion: https://postgr.es/m/alpine.DEB.2.20.1801101038340.2283@lancre B

pgsql: Fix VM buffer pin management in heap_lock_updated_tuple_rec().

2018-03-02 Thread Tom Lane
Fix VM buffer pin management in heap_lock_updated_tuple_rec(). Sloppy coding in this function could lead to leaking a VM buffer pin, or to attempting to free the same pin twice. Repair. While at it, reduce the code's tendency to free and reacquire the same page pin. Back-patch to 9.6; before th

pgsql: Fix VM buffer pin management in heap_lock_updated_tuple_rec().

2018-03-02 Thread Tom Lane
Fix VM buffer pin management in heap_lock_updated_tuple_rec(). Sloppy coding in this function could lead to leaking a VM buffer pin, or to attempting to free the same pin twice. Repair. While at it, reduce the code's tendency to free and reacquire the same page pin. Back-patch to 9.6; before th

pgsql: Fix VM buffer pin management in heap_lock_updated_tuple_rec().

2018-03-02 Thread Tom Lane
Fix VM buffer pin management in heap_lock_updated_tuple_rec(). Sloppy coding in this function could lead to leaking a VM buffer pin, or to attempting to free the same pin twice. Repair. While at it, reduce the code's tendency to free and reacquire the same page pin. Back-patch to 9.6; before th

pgsql: Add PG_TEST_EXTRA to control optional test suites

2018-03-02 Thread Peter Eisentraut
Add PG_TEST_EXTRA to control optional test suites The SSL and LDAP test suites are not run by default, as they are not secure for multi-user environments. This commit adds an extra make variable to optionally enable them, for example: make check-world PG_TEST_EXTRA='ldap ssl' Author: Michael Pa