pgsql: Update expected files for older Python versions

2018-05-03 Thread Peter Eisentraut
Update expected files for older Python versions neglected in commit fa03769e4c4bf0911da71fba2501006b05ea195a Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7d8679975f650d1150d706c8b6a5f04f08dcdd00 Modified Files -- src/pl/plpython/expected/plpython_sub

pgsql: Blindly try to fix MSVC build's use of genbki.pl and Gen_fmgrtab

2018-05-03 Thread Tom Lane
Blindly try to fix MSVC build's use of genbki.pl and Gen_fmgrtab.pl. We need to use a stamp file to record the runs of these scripts, as is done on the Unix side. I think I got it right, but can't test. While at it, extend this handmade dependency logic to also check the generating script files,

pgsql: Avoid overwriting unchanged output files in genbki.pl and Gen_fm

2018-05-03 Thread Tom Lane
Avoid overwriting unchanged output files in genbki.pl and Gen_fmgrtab.pl. If a particular output file already exists with the contents it should have, leave it alone, so that its mod timestamp is not advanced. In builds using --enable-depend, this can avoid the need to recompile .c files whose in

pgsql: Rearrange makefile rules for running Gen_fmgrtab.pl.

2018-05-03 Thread Tom Lane
Rearrange makefile rules for running Gen_fmgrtab.pl. Make these rules look more like the ones associated with genbki.pl, to wit: * Use a stamp file to record when we last ran the script, instead of relying on the timestamps of the individual output files. * Take the knowledge out of backend/Make

pgsql: Tweak tests to support Python 3.7

2018-05-03 Thread Peter Eisentraut
Tweak tests to support Python 3.7 Python 3.7 removes the trailing comma in the repr() of BaseException (see ), leading to test output differences. Work around that by composing the equivalent test output in a more manual way. Branch -- master Details

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Add HOLD_INTERRUPTS section into FinishPreparedTransaction.

2018-05-03 Thread Teodor Sigaev
Add HOLD_INTERRUPTS section into FinishPreparedTransaction. If an interrupt arrives in the middle of FinishPreparedTransaction and any callback decide to call CHECK_FOR_INTERRUPTS (e.g. RemoveTwoPhaseFile can write a warning with ereport, which checks for interrupts) then it's possible to leave cu

pgsql: Avoid portability issues in autoprewarm.c.

2018-05-03 Thread Tom Lane
Avoid portability issues in autoprewarm.c. autoprewarm.c mostly considered the number of blocks it might be dealing with as being int64. This is unnecessary, because NBuffers is declared as int, and there's been no suggestion that we might widen it in the foreseeable future. Moreover, using int6

pgsql: Fix pg_dump support for pre-8.2 versions

2018-05-03 Thread Teodor Sigaev
Fix pg_dump support for pre-8.2 versions Unify indnkeys/indnatts/indnkeyatts usage for all version of query to get index information, remove indnkeys column from query as unused. Author: Marina Polyakova Noticed by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.

pgsql: Further improve code for probing the availability of ARM CRC ins

2018-05-03 Thread Tom Lane
Further improve code for probing the availability of ARM CRC instructions. Andrew Gierth pointed out that commit 1c72ec6f4 would yield the wrong answer on big-endian ARM systems, because the data being CRC'd would be different. To fix that, and avoid the rather unsightly hard-wired constant, simp

pgsql: Fix SPI error cleanup and memory leak

2018-05-03 Thread Peter Eisentraut
Fix SPI error cleanup and memory leak Since the SPI stack has been moved from TopTransactionContext to TopMemoryContext, setting _SPI_stack to NULL in AtEOXact_SPI() leaks memory. In fact, we don't need to do that anymore: We just leave the allocated stack around for the next SPI use. Also, refa

Re: pgsql: Test conversion of NaN between float4 and float8.

2018-05-03 Thread Glyn Astill
Apologies Tom, I missed this; opossum is running one of its infrequent build runs now. On Sat, 21/4/18, Tom Lane wrote: Subject: pgsql: Test conversion of NaN between float4 and float8. To: pgsql-committers@lists.postgresql.org Date: Saturday, 21

Re: pgsql: Indexes with INCLUDE columns and their support in B-tree

2018-05-03 Thread Teodor Sigaev
Thank you, will see Peter Eisentraut wrote: On 4/7/18 16:01, Teodor Sigaev wrote: Indexes with INCLUDE columns and their support in B-tree pg_dump from <8.2 servers is now failing. The last branch in getIndexes() is not producing the required indnkeyatts column. -- Teodor Sigaev