pgsql: Adapt to LLVM 7+ Orc API changes.

2018-03-26 Thread Andres Freund
Adapt to LLVM 7+ Orc API changes. This is mostly done to be able to validate features and fixes submitted to LLVM. Given the size of these changes that seems acceptable. Author: Andres Freund Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4b9094eb6e14dfdbed61278ea

pgsql: Make new regression indpendent of max_parallel_workers_per_gath

2018-03-26 Thread Andres Freund
Make new regression indpendent of max_parallel_workers_per_gather. The tests in e2f1eb0ee30d1 ("Implement partition-wise grouping/aggregation.") weren't independent of the server's max_parallel_workers_per_gather setting. I (Andres) find it useful to locally run with that disabled, and the afore

pgsql: LLVMJIT: Free created module in LLVM < 5.

2018-03-26 Thread Andres Freund
LLVMJIT: Free created module in LLVM < 5. Due to the differing APIs between versions, I forgot to deallocate the generated module in older LLVM versions, leading to a memory leak. Author: Andres Freund Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/071371bc43c89d6

pgsql: Correct some typos in the new JIT code.

2018-03-26 Thread Andres Freund
Correct some typos in the new JIT code. Author: Thomas Munro Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/96b5eac9186e033c67944124803ef5aa8f246afc Modified Files -- src/backend/jit/llvm/llvmjit.c | 12 ++-- src/backend/jit/llvm/llvmjit

pgsql: JIT tuple deforming in LLVM JIT provider.

2018-03-26 Thread Andres Freund
JIT tuple deforming in LLVM JIT provider. Performing JIT compilation for deforming gains performance benefits over unJITed deforming from compile-time knowledge of the tuple descriptor. Fixed column widths, NOT NULLness, etc can be taken advantage of. Right now the JITed deforming is only used wh

Re: pgsql: Allow FOR EACH ROW triggers on partitioned tables

2018-03-26 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera writes: > > Andres Freund wrote: > >> The inherit.sql here looks like it's racing against the concurrentlys > >> scheduled triggers.sql according to my new desmoxytes animal: > >> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=desmoxytes&dt=2018-03-25%2004

pgsql: Set random seed for pgbench.

2018-03-26 Thread Teodor Sigaev
Set random seed for pgbench. Setting random could increase reproducibility of test in some cases. Patch suggests three providers for seed: time (default), strong random generator (if available) and unsigned constant. Seed could be set from command line or enviroment variable. Author: Fabien Coelh

pgsql: Fix thinko in comment

2018-03-26 Thread Alvaro Herrera
Fix thinko in comment The listed numbers disagreed with the ones being used in the symbols; but instead of just fixing the numbers in the comment, use the symbolic name instead, which seems clearer. This has been wrong all along, so apply back to 9.5 where BRIN was introduced. Reported-by: Tomas

pgsql: Fix thinko in comment

2018-03-26 Thread Alvaro Herrera
Fix thinko in comment The listed numbers disagreed with the ones being used in the symbols; but instead of just fixing the numbers in the comment, use the symbolic name instead, which seems clearer. This has been wrong all along, so apply back to 9.5 where BRIN was introduced. Reported-by: Tomas

pgsql: Fix test impredictability

2018-03-26 Thread Alvaro Herrera
Fix test impredictability Test 'triggers' fails when another one creates triggers concurrently at some precise time, because of a missing WHERE clause. Per buildfarm members snapper, desmoxytes. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/186b6df2e62251e5e1f3ca

pgsql: Fix thinko in comment

2018-03-26 Thread Alvaro Herrera
Fix thinko in comment The listed numbers disagreed with the ones being used in the symbols; but instead of just fixing the numbers in the comment, use the symbolic name instead, which seems clearer. This has been wrong all along, so apply back to 9.5 where BRIN was introduced. Reported-by: Tomas

pgsql: Fix thinko in comment

2018-03-26 Thread Alvaro Herrera
Fix thinko in comment The listed numbers disagreed with the ones being used in the symbols; but instead of just fixing the numbers in the comment, use the symbolic name instead, which seems clearer. This has been wrong all along, so apply back to 9.5 where BRIN was introduced. Reported-by: Tomas

Re: pgsql: Allow FOR EACH ROW triggers on partitioned tables

2018-03-26 Thread Tom Lane
Alvaro Herrera writes: > Andres Freund wrote: >> The inherit.sql here looks like it's racing against the concurrentlys >> scheduled triggers.sql according to my new desmoxytes animal: >> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=desmoxytes&dt=2018-03-25%2004%3A48%3A01 > You're right

Re: pgsql: Allow FOR EACH ROW triggers on partitioned tables

2018-03-26 Thread Alvaro Herrera
Andres Freund wrote: > On 2018-03-23 13:48:53 +, Alvaro Herrera wrote: > > Allow FOR EACH ROW triggers on partitioned tables > The inherit.sql here looks like it's racing against the concurrentlys > scheduled triggers.sql according to my new desmoxytes animal: > https://buildfarm.postgresql.o

pgsql: Handle INSERT .. ON CONFLICT with partitioned tables

2018-03-26 Thread Alvaro Herrera
Handle INSERT .. ON CONFLICT with partitioned tables Commit eb7ed3f30634 enabled unique constraints on partitioned tables, but one thing that was not working properly is INSERT/ON CONFLICT. This commit introduces a new node keeps state related to the ON CONFLICT clause per partition, and fills it

pgsql: Fix typo

2018-03-26 Thread Alvaro Herrera
Fix typo Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1b89c2188bd38eac68251f16051859996128f2d0 Modified Files -- src/backend/optimizer/plan/setrefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo

2018-03-26 Thread Alvaro Herrera
Fix typo Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/29c5e341733f3fcc4b790857d663f73a41e6e194 Modified Files -- src/backend/optimizer/plan/setrefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Remove two tests inadvertently added in 2b27273435

2018-03-26 Thread Andrew Dunstan
Remove two tests inadvertently added in 2b27273435 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1d494b622fa9dfdbd7213f357cd38def0125a322 Modified Files -- src/test/regress/expected/indexing.out | 16 src/test/regress/sql/indexing.sql

pgsql: Optimize btree insertions for common case of increasing values

2018-03-26 Thread Andrew Dunstan
Optimize btree insertions for common case of increasing values Remember the last page of an index insert if it's the rightmost leaf page. If the next entry belongs on and can fit in the remembered page, insert the new entry there as long as we can get a lock on the page. Otherwise, fall back on th