[COMMITTERS] pgsql: Make tablesync worker exit when apply dies while it was waiting

2017-06-03 Thread Peter Eisentraut
Make tablesync worker exit when apply dies while it was waiting for it This avoids "orphaned" sync workers. This was caused by a thinko in wait_for_sync_status_change. Author: Petr Jelinek Reported-by: Masahiko Sawada Branch -- master Details --- https://git.postgresql.org/pg/commitd

[COMMITTERS] pgsql: Receive invalidation messages correctly in tablesync worker

2017-06-03 Thread Peter Eisentraut
Receive invalidation messages correctly in tablesync worker We didn't accept any invalidation messages until the whole sync process had finished (because it flattens all the remote transactions in the single one). So the sync worker didn't learn about subscription changes/drop until it has finish

[COMMITTERS] pgsql: Fix old corner-case logic error in final_cost_nestloop().

2017-06-03 Thread Tom Lane
Fix old corner-case logic error in final_cost_nestloop(). When costing a nestloop with stop-at-first-inner-match semantics, and a non-indexscan inner path, final_cost_nestloop() wants to charge the full scan cost of the inner rel at least once, with additional scans charged at inner_rescan_run_cos

[COMMITTERS] pgsql: Fix <> and pattern-NOT-match estimators to handle nulls correctl

2017-06-03 Thread Tom Lane
Fix <> and pattern-NOT-match estimators to handle nulls correctly. These estimators returned 1 minus the corresponding equality/match estimate, which is incorrect: we need to subtract off the fraction of nulls in the column, since those are neither equal nor not equal to the comparison value. The

[COMMITTERS] pgsql: Add some missing backslash commands to psql's tab-completion kno

2017-06-03 Thread Tom Lane
Add some missing backslash commands to psql's tab-completion knowledge. \if and related commands were overlooked here, as were \dRp and \dRs from the logical-replication patch, as was \?. While here, reformat the list to put each new first command letter on a separate line; perhaps that will limi

[COMMITTERS] pgsql: Remove dead variables.

2017-06-03 Thread Tom Lane
Remove dead variables. Commit 512c7356b left a couple of variables unused except for being set. My compiler didn't whine about this, but some buildfarm members did. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/5936d25f8101f2433e8242794d2275c7a05273bf Modified Fi