[COMMITTERS] pgsql: Add testing to detect errors of omission in "pin" dependency cre

2017-06-23 Thread Tom Lane
Add testing to detect errors of omission in "pin" dependency creation. It's essential that initdb.c's setup_depend() scan each system catalog that could contain objects that need to have "p" (pin) entries in pg_depend or pg_shdepend. Forgetting to add that, either when a catalog is first invented

[COMMITTERS] pgsql: Fix memory leakage in ICU encoding conversion, and other code re

2017-06-23 Thread Tom Lane
Fix memory leakage in ICU encoding conversion, and other code review. Callers of icu_to_uchar() neglected to pfree the result string when done with it. This results in catastrophic memory leaks in varstr_cmp(), because of our prevailing assumption that btree comparison functions don't leak memory

[COMMITTERS] pgsql: Minor corrections to high availability docs

2017-06-23 Thread Simon Riggs
Minor corrections to high availability docs Startup process is displayed in pg_stat_activity, noted by Yugo Nagata. Transactions can be resolved at end of recovery. Author: Yugo Nagata, with addition by me Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a79122b0619

[COMMITTERS] pgsql: Improve replication lag interpolation after idle period

2017-06-23 Thread Simon Riggs
Improve replication lag interpolation after idle period After sitting idle and fully replayed for a while and then encountering a new burst of WAL activity, we interpolate between an ancient sample and the not-yet-reached one for the new traffic. That produced a corner case report of lag after rec

[COMMITTERS] pgsql: Rethink behavior of pg_import_system_collations().

2017-06-23 Thread Tom Lane
Rethink behavior of pg_import_system_collations(). Marco Atzeri reported that initdb would fail if "locale -a" reported the same locale name more than once. All previous versions of Postgres implicitly de-duplicated the results of "locale -a", but the rewrite to move the collation import logic in

[COMMITTERS] pgsql: Fix replication with replica identity full

2017-06-23 Thread Peter Eisentraut
Fix replication with replica identity full The comparison with the target rows on the subscriber side was done with datumIsEqual(), which can have false negatives. For instance, it didn't work reliably for text columns. So use the equality operator provided by the type cache instead. Also add m

[COMMITTERS] pgsql: Fix incorrect buffer-length argument to uloc_getDisplayName().

2017-06-23 Thread Tom Lane
Fix incorrect buffer-length argument to uloc_getDisplayName(). The maxResultSize argument of uloc_getDisplayName is the number of UChars in the output buffer, not the number of bytes. In principle this could result in a stack smash, although at least in my Fedora 25 install there are no ICU local