Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-13 Thread Christoph Berg
Re: Andres Freund 2017-12-13 > Provide overflow safe integer math inline functions. The new _overflow functions have buggy comments: /* * If a - b overflows, return true, otherwise store the result of a + b into * *result. ^ there Christ

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-13 Thread Robert Haas
On Wed, Dec 13, 2017 at 5:10 AM, Christoph Berg wrote: > Re: Andres Freund 2017-12-13 >> Provide overflow safe integer math inline functions. > > The new _overflow functions have buggy comments: > > /* > * If a - b overflows, return true, otherwise store the result of a + b into > * *result.

pgsql: Fix crash when using CALL on an aggregate

2017-12-13 Thread Peter Eisentraut
Fix crash when using CALL on an aggregate Author: Ashutosh Bapat Reported-by: Rushabh Lathia Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3d8874224ff25de3ca4f9da8ce3118391bd6609e Modified Files -- src/backend/parser/parse_func.c| 9

pgsql: Start a separate test suite for plpgsql

2017-12-13 Thread Peter Eisentraut
Start a separate test suite for plpgsql The plpgsql.sql test file in the main regression tests is now by far the largest after numeric_big, making editing and managing the test cases very cumbersome. The other PLs have their own test suites split up into smaller files by topic. It would be nice

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-13 Thread Andres Freund
On 2017-12-13 09:37:25 -0500, Robert Haas wrote: > On Wed, Dec 13, 2017 at 5:10 AM, Christoph Berg wrote: > > Re: Andres Freund 2017-12-13 > >> Provide overflow safe integer math inline functions. > > > > The new _overflow functions have buggy comments: > > > > /* > > * If a - b overflows, retur

pgsql: Rethink MemoryContext creation to improve performance.

2017-12-13 Thread Tom Lane
Rethink MemoryContext creation to improve performance. This patch makes a number of interrelated changes to reduce the overhead involved in creating/deleting memory contexts. The key ideas are: * Include the AllocSetContext header of an aset.c context in its first malloc request, rather than all

pgsql: Revert "Fix accumulation of parallel worker instrumentation."

2017-12-13 Thread Robert Haas
Revert "Fix accumulation of parallel worker instrumentation." This reverts commit 778e78ae9fa51e58f41cbdc72b293291d02d8984. Per further discussion, that doesn't seem to be the best possible fix. Discussion: http://postgr.es/m/CAA4eK1LW2aFKzY3=vwvc=t-juzppvwp2ut1bpx_meyeqnm+...@mail.gmail.com B

pgsql: Revert "Fix accumulation of parallel worker instrumentation."

2017-12-13 Thread Robert Haas
Revert "Fix accumulation of parallel worker instrumentation." This reverts commit 2c09a5c12a66087218c7f8cba269cd3de51b9b82. Per further discussion, that doesn't seem to be the best possible fix. Discussion: http://postgr.es/m/CAA4eK1LW2aFKzY3=vwvc=t-juzppvwp2ut1bpx_meyeqnm+...@mail.gmail.com B

pgsql: Fix parallel index scan hang with deleted or half-dead pages.

2017-12-13 Thread Robert Haas
Fix parallel index scan hang with deleted or half-dead pages. The previous coding forgot to release the scan before seizing it again, leading to a lockup. Report by Patrick Hemmer. Diagnosis by Thomas Munro. Patch by Amit Kapila. Discussion: http://postgr.es/m/CAEepm=2xZUcOGP9V0O_G0=2P2wwXwPr

pgsql: Fix parallel index scan hang with deleted or half-dead pages.

2017-12-13 Thread Robert Haas
Fix parallel index scan hang with deleted or half-dead pages. The previous coding forgot to release the scan before seizing it again, leading to a lockup. Report by Patrick Hemmer. Diagnosis by Thomas Munro. Patch by Amit Kapila. Discussion: http://postgr.es/m/CAEepm=2xZUcOGP9V0O_G0=2P2wwXwPr

pgsql: Add defenses against pre-crash files to BufFileOpenShared().

2017-12-13 Thread Andres Freund
Add defenses against pre-crash files to BufFileOpenShared(). Crash restarts currently don't clean up temporary files, as a debugging aid. If a left-over file happens to have the same name as a segment file we're trying to create, we'll just truncate and reuse it, but there is a problem: BufFileOpe

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-13 Thread Andres Freund
Hi Michael, On 2017-12-13 01:01:19 +, Andres Freund wrote: > Provide overflow safe integer math inline functions. https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=dangomushi&dt=2017-12-13%2018%3A00%3A18 which seems half like a compiler bug to me. But either way, we gotta work around i

pgsql: Allow executor nodes to change their ExecProcNode function.

2017-12-13 Thread Andres Freund
Allow executor nodes to change their ExecProcNode function. In order for executor nodes to be able to change their ExecProcNode function after ExecInitNode() has finished, provide ExecSetExecProcNode(). This allows any wrappers functions that only execProcnode.c knows about to be reinstalled. The

pgsql: Add pg_attribute_always_inline.

2017-12-13 Thread Andres Freund
Add pg_attribute_always_inline. Sometimes it is useful to be able to insist that the compiler inline a function that its normal cost analysis would not normally choose to inline. This can be useful for instantiating different variants of a function that remove branches of code by constant folding.