Re: pgsql: Set random seed for pgbench.

2018-03-31 Thread Fabien COELHO
Hello Tom, Set random seed for pgbench. So this patch has ignored the possibility of not having pg_strong_random. I assumed that pg_strong_random is always available, but may fail with an error if a strong random source is not available, in which case the error message should be enough fo

Re: pgsql: Add documentation for the JIT feature.

2018-03-31 Thread Peter Eisentraut
On 3/29/18 14:43, Alvaro Herrera wrote: >> Hm, what's wrong just doing it in the normal build? It's a desired build >> artifact, so I really don't see any argument for not building it by >> default? Don't quite see what the advantage of doing it during make >> check would be? > I meant running som

Re: pgsql: Add documentation for the JIT feature.

2018-03-31 Thread Tom Lane
Peter Eisentraut writes: > On 3/29/18 14:43, Alvaro Herrera wrote: >>> Hm, what's wrong just doing it in the normal build? It's a desired build >>> artifact, so I really don't see any argument for not building it by >>> default? Don't quite see what the advantage of doing it during make >>> check

Re: pgsql: Add documentation for the JIT feature.

2018-03-31 Thread Andres Freund
On March 31, 2018 8:43:37 AM PDT, Tom Lane wrote: >Peter Eisentraut writes: >> On 3/29/18 14:43, Alvaro Herrera wrote: > I'm *not* OK with expanding the scope of "make check" >to include building the documentation. It's never had anything to do >with docs before and I see no reason to start no

Re: pgsql: Add documentation for the JIT feature.

2018-03-31 Thread Tom Lane
Andres Freund writes: > On March 31, 2018 8:43:37 AM PDT, Tom Lane wrote: >> I don't want to waste cycles on testing docs when I'm trying >> to test code, any more than I would like the reverse (ie forcing a docs >> build to build code too). > They're a local check target in the docs directory.

Re: pgsql: Add documentation for the JIT feature.

2018-03-31 Thread Alvaro Herrera
Tom Lane wrote: > Andres Freund writes: > > On March 31, 2018 8:43:37 AM PDT, Tom Lane wrote: > >> I don't want to waste cycles on testing docs when I'm trying > >> to test code, any more than I would like the reverse (ie forcing a docs > >> build to build code too). > > > They're a local check

pgsql: Fix portability and translatability issues in commit 64f85894a.

2018-03-31 Thread Tom Lane
Fix portability and translatability issues in commit 64f85894a. Compilation failed for lack of an #ifdef on builds without pg_strong_random(). Also fix relevant error messages to meet project style guidelines. Fabien Coelho, further adjusted by me Discussion: https://postgr.es/m/32390.1522464..

Re: pgsql: Set random seed for pgbench.

2018-03-31 Thread Tom Lane
Fabien COELHO writes: >> So this patch has ignored the possibility of not having pg_strong_random. > I assumed that pg_strong_random is always available, ... which is wrong. Every other call of it is wrapped in #ifdef HAVE_STRONG_RANDOM, and so must this one be. We can use the same error messag

Re: pgsql: Set random seed for pgbench.

2018-03-31 Thread Fabien COELHO
I assumed that pg_strong_random is always available, ... which is wrong. Every other call of it is wrapped in #ifdef HAVE_STRONG_RANDOM, and so must this one be. Indeed, I clearly misunderstood its usage pattern. I looked at its source ("src/port/pg_strong_random.c") where the function is

pgsql: Fix assorted issues in parallel vacuumdb.

2018-03-31 Thread Tom Lane
Fix assorted issues in parallel vacuumdb. Avoid storing the result of PQsocket() in a pgsocket variable; it's declared as int, and the no-socket test is properly written as "x < 0" not "x == PGINVALID_SOCKET". This accidentally had no bad effect because we never got to init_slot() with a bad conn

pgsql: Fix assorted issues in parallel vacuumdb.

2018-03-31 Thread Tom Lane
Fix assorted issues in parallel vacuumdb. Avoid storing the result of PQsocket() in a pgsocket variable; it's declared as int, and the no-socket test is properly written as "x < 0" not "x == PGINVALID_SOCKET". This accidentally had no bad effect because we never got to init_slot() with a bad conn

pgsql: Fix assorted issues in parallel vacuumdb.

2018-03-31 Thread Tom Lane
Fix assorted issues in parallel vacuumdb. Avoid storing the result of PQsocket() in a pgsocket variable; it's declared as int, and the no-socket test is properly written as "x < 0" not "x == PGINVALID_SOCKET". This accidentally had no bad effect because we never got to init_slot() with a bad conn

pgsql: Fix assorted issues in parallel vacuumdb.

2018-03-31 Thread Tom Lane
Fix assorted issues in parallel vacuumdb. Avoid storing the result of PQsocket() in a pgsocket variable; it's declared as int, and the no-socket test is properly written as "x < 0" not "x == PGINVALID_SOCKET". This accidentally had no bad effect because we never got to init_slot() with a bad conn

pgsql: Small cleanups in fast default code.

2018-03-31 Thread Andrew Dunstan
Small cleanups in fast default code. Problems identified by Andres Freund and Haribabu Kommi Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/ed69864350a59c51c8570900601ebd335956b638 Modified Files -- src/backend/access/common/heaptuple.c | 13 --

pgsql: Add Bloom filter implementation.

2018-03-31 Thread Andres Freund
Add Bloom filter implementation. A Bloom filter is a space-efficient, probabilistic data structure that can be used to test set membership. Callers will sometimes incur false positives, but never false negatives. The rate of false positives is a function of the total number of elements and the a

pgsql: Add amcheck verification of heap relations belonging to btree in

2018-03-31 Thread Andres Freund
Add amcheck verification of heap relations belonging to btree indexes. Add a new, optional, capability to bt_index_check() and bt_index_parent_check(): check that each heap tuple that should have an index entry does in fact have one. The extra checking is performed at the end of the existing nbt

pgsql: Fix non-portable use of round().

2018-03-31 Thread Andres Freund
Fix non-portable use of round(). round() is from C99. Use rint() instead. There are behavioral differences between round() and rint(), but they should not matter to the Bloom filter optimal_k() function. We already assume POSIX behavior for rint(), so there is no question of rint() not using "r