Re: [COMMITTERS] pgsql: pg_upgrade: preserve database and relation minmxid values

2016-03-27 Thread Andres Freund
Hi, On 2014-07-02 19:29:43 +, Bruce Momjian wrote: > pg_upgrade: preserve database and relation minmxid values > > Also set these values for pre-9.3 old clusters that don't have values to > preserve. > > Analysis by Alvaro > > Backpatch through 9.3 My compiler quite correctly complains about

[COMMITTERS] pgsql: Change various Gin*Is* macros to return 0/1.

2016-03-27 Thread Andres Freund
Change various Gin*Is* macros to return 0/1. Returning the direct result of bit arithmetic, in a macro intended to be used in a boolean manner, can be problematic if the return value is stored in a variable of type 'bool'. If bool is implemented using C99's _Bool, that can lead to comparison failu

[COMMITTERS] pgsql: Change various Gin*Is* macros to return 0/1.

2016-03-27 Thread Andres Freund
Change various Gin*Is* macros to return 0/1. Returning the direct result of bit arithmetic, in a macro intended to be used in a boolean manner, can be problematic if the return value is stored in a variable of type 'bool'. If bool is implemented using C99's _Bool, that can lead to comparison failu

[COMMITTERS] pgsql: Change various Gin*Is* macros to return 0/1.

2016-03-27 Thread Andres Freund
Change various Gin*Is* macros to return 0/1. Returning the direct result of bit arithmetic, in a macro intended to be used in a boolean manner, can be problematic if the return value is stored in a variable of type 'bool'. If bool is implemented using C99's _Bool, that can lead to comparison failu

[COMMITTERS] pgsql: Change various Gin*Is* macros to return 0/1.

2016-03-27 Thread Andres Freund
Change various Gin*Is* macros to return 0/1. Returning the direct result of bit arithmetic, in a macro intended to be used in a boolean manner, can be problematic if the return value is stored in a variable of type 'bool'. If bool is implemented using C99's _Bool, that can lead to comparison failu

[COMMITTERS] pgsql: Change various Gin*Is* macros to return 0/1.

2016-03-27 Thread Andres Freund
Change various Gin*Is* macros to return 0/1. Returning the direct result of bit arithmetic, in a macro intended to be used in a boolean manner, can be problematic if the return value is stored in a variable of type 'bool'. If bool is implemented using C99's _Bool, that can lead to comparison failu

[COMMITTERS] pgsql: Change various Gin*Is* macros to return 0/1.

2016-03-27 Thread Andres Freund
Change various Gin*Is* macros to return 0/1. Returning the direct result of bit arithmetic, in a macro intended to be used in a boolean manner, can be problematic if the return value is stored in a variable of type 'bool'. If bool is implemented using C99's _Bool, that can lead to comparison failu

[COMMITTERS] pgsql: Don't use !! but != 0/NULL to force boolean evaluation.

2016-03-27 Thread Andres Freund
Don't use !! but != 0/NULL to force boolean evaluation. I introduced several uses of !! to force bit arithmetic to be boolean, but per discussion the project prefers != 0/NULL. Discussion: ca+tgmozp5kaklgp6b4vujgmbuw0woq_djyi0paoz-my0hwt...@mail.gmail.com Branch -- master Details --- ht

[COMMITTERS] pgsql: pg_rewind: Close backup_label file descriptor.

2016-03-27 Thread Andres Freund
pg_rewind: Close backup_label file descriptor. This was a relatively harmless leak, as createBackupLabel() is only called once per pg_rewind invocation. Author: Michael Paquier Reported-By: Michael Paquier Discussion: cab7npqrnow30goxe2_spljh37bgm4v+txbyapwoxb97ngq2...@mail.gmail.com Backpatch: 9

[COMMITTERS] pgsql: pg_rewind: Close backup_label file descriptor.

2016-03-27 Thread Andres Freund
pg_rewind: Close backup_label file descriptor. This was a relatively harmless leak, as createBackupLabel() is only called once per pg_rewind invocation. Author: Michael Paquier Reported-By: Michael Paquier Discussion: cab7npqrnow30goxe2_spljh37bgm4v+txbyapwoxb97ngq2...@mail.gmail.com Backpatch: 9

[COMMITTERS] pgsql: Fix LWLockReportWaitEnd() parameter list to be (void).

2016-03-27 Thread Andres Freund
Fix LWLockReportWaitEnd() parameter list to be (void). Previously it was an "old style" function declaration. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/9f7c527af308dcdaba2f0ff9d362d672e8886fb1 Modified Files -- src/backend/storage/lmgr/lwlock.c | 4

[COMMITTERS] pgsql: pg_rewind: fsync target data directory.

2016-03-27 Thread Andres Freund
pg_rewind: fsync target data directory. Previously pg_rewind did not fsync any files. That's problematic, given that the target directory is modified. If the database was started afterwards, 2ce439f33 luckily already caused the data directory to be synced to disk at postmaster startup; reducing th

[COMMITTERS] pgsql: pg_rewind: fsync target data directory.

2016-03-27 Thread Andres Freund
pg_rewind: fsync target data directory. Previously pg_rewind did not fsync any files. That's problematic, given that the target directory is modified. If the database was started afterwards, 2ce439f33 luckily already caused the data directory to be synced to disk at postmaster startup; reducing th

[COMMITTERS] pgsql: Clamp adjusted ndistinct to positive integer in estimate_hash_bu

2016-03-27 Thread Tom Lane
Clamp adjusted ndistinct to positive integer in estimate_hash_bucketsize(). This avoids a possible divide-by-zero in the following calculation, and rounding the number to an integer seems like saner behavior anyway. Assuming IEEE math, the division would yield +Infinity which would get replaced by

[COMMITTERS] pgsql: Guard against zero vardata.rel->tuples in estimate_hash_bucketsi

2016-03-27 Thread Tom Lane
Guard against zero vardata.rel->tuples in estimate_hash_bucketsize(). If the referenced rel was proven empty, we'd compute 0/0 here, which results in the function returning NaN. That's a bit more serious than the other zero-divide case. Still, it only seems to be possible in HEAD, so no back-pat

[COMMITTERS] pgsql: Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21.

2016-03-27 Thread Tom Lane
Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21. Branch -- REL9_2_STABLE Details --- http://git.postgresql.org/pg/commitdiff/938e74e0ddbdd6931f65c54d2035de937c212140 Modified Files -- doc/src/sgml/release-9.1.sgml | 206 ++ doc/sr

[COMMITTERS] pgsql: Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21.

2016-03-27 Thread Tom Lane
Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21. Branch -- REL9_4_STABLE Details --- http://git.postgresql.org/pg/commitdiff/8c3672f0a35ea0b981c4a328b3c6d80a3b99a8b9 Modified Files -- doc/src/sgml/release-9.1.sgml | 206 doc/src/sgml/rel

[COMMITTERS] pgsql: Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21.

2016-03-27 Thread Tom Lane
Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21. Branch -- REL9_3_STABLE Details --- http://git.postgresql.org/pg/commitdiff/9d050969966e9a1c1cd3f99812617f6c64f5703b Modified Files -- doc/src/sgml/release-9.1.sgml | 206 +++ doc/src/s

[COMMITTERS] pgsql: Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21.

2016-03-27 Thread Tom Lane
Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21. Branch -- REL9_1_STABLE Details --- http://git.postgresql.org/pg/commitdiff/bb4b4d1cf9881334a5f038631eccf371df1841c0 Modified Files -- doc/src/sgml/release-9.1.sgml | 206 ++ 1 file

[COMMITTERS] pgsql: Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21.

2016-03-27 Thread Tom Lane
Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/499a50571c72f41bb1365970d55dae5c8afcb6ba Modified Files -- doc/src/sgml/release-9.1.sgml | 206 doc/src/sgml/release-9.

[COMMITTERS] pgsql: Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21.

2016-03-27 Thread Tom Lane
Release notes for 9.5.2, 9.4.7, 9.3.12, 9.2.16, 9.1.21. Branch -- REL9_5_STABLE Details --- http://git.postgresql.org/pg/commitdiff/4a1d57d4dafe543fa5be2f6546df97c5ce5d8f63 Modified Files -- doc/src/sgml/release-9.1.sgml | 206 + doc/src/sgml/release-9.2.sgml | 206

[COMMITTERS] pgsql: Code and docs review for commit 3187d6de0e5a9e805b27c48437897e8c

2016-03-27 Thread Tom Lane
Code and docs review for commit 3187d6de0e5a9e805b27c48437897e8c39071d45. Fix up check for high-bit-set characters, which provoked "comparison is always true due to limited range of data type" warnings on some compilers, and was unlike the way we do it elsewhere anyway. Fix omission of "$" from t