Re: [COMMITTERS] pgsql: Replace our hacked version of ax_pthread.m4 with latest upstream

2015-08-02 Thread Heikki Linnakangas
On 07/26/2015 10:49 AM, Heikki Linnakangas wrote: On 07/26/2015 12:19 AM, Tom Lane wrote: I've located another problem in the new improved ax_pthread.m4 script: prairiedog is now concluding that it should use -pthread, which leads to a whole bunch of build warnings along the lines of powerpc-ap

[COMMITTERS] Taint mode in PL/Perl

2015-08-02 Thread Terry Scheingeld
I've googled and read documentation but I can't figure this out. How do I configure Postgres so that PL/Perl runs in taint mode? I understand that plperl runs in "safe mode" but that's not quite the same thing as taint mode. I do know that it's not running in taint mode because this script returns

[COMMITTERS] pgsql: Micro optimize LWLockAttemptLock() a bit.

2015-08-02 Thread Andres Freund
Micro optimize LWLockAttemptLock() a bit. LWLockAttemptLock pointlessly read the lock's state in every loop iteration, even though pg_atomic_compare_exchange_u32() returns the old value. Instead do that only once before the loop iteration. Additionally there's no need to have the expected_state v

[COMMITTERS] pgsql: Fix issues around the "variable" support in the lwlock infrastru

2015-08-02 Thread Andres Freund
Fix issues around the "variable" support in the lwlock infrastructure. The lwlock scalability work introduced two race conditions into the lwlock variable support provided for xlog.c. First, and harmlessly on most platforms, it set/read the variable without the spinlock in some places. Secondly, d

[COMMITTERS] pgsql: Micro optimize LWLockAttemptLock() a bit.

2015-08-02 Thread Andres Freund
Micro optimize LWLockAttemptLock() a bit. LWLockAttemptLock pointlessly read the lock's state in every loop iteration, even though pg_atomic_compare_exchange_u32() returns the old value. Instead do that only once before the loop iteration. Additionally there's no need to have the expected_state v

[COMMITTERS] pgsql: Fix issues around the "variable" support in the lwlock infrastru

2015-08-02 Thread Andres Freund
Fix issues around the "variable" support in the lwlock infrastructure. The lwlock scalability work introduced two race conditions into the lwlock variable support provided for xlog.c. First, and harmlessly on most platforms, it set/read the variable without the spinlock in some places. Secondly, d

[COMMITTERS] pgsql: Fix race condition that lead to WALInsertLock deadlock with comm

2015-08-02 Thread Heikki Linnakangas
Fix race condition that lead to WALInsertLock deadlock with commit_delay. If a call to WaitForXLogInsertionsToFinish() returned a value in the middle of a page, and another backend then started to insert a record to the same page, and then you called WaitXLogInsertionsToFinish() again, the second

[COMMITTERS] pgsql: Fix race condition that lead to WALInsertLock deadlock with comm

2015-08-02 Thread Heikki Linnakangas
Fix race condition that lead to WALInsertLock deadlock with commit_delay. If a call to WaitForXLogInsertionsToFinish() returned a value in the middle of a page, and another backend then started to insert a record to the same page, and then you called WaitXLogInsertionsToFinish() again, the second

[COMMITTERS] pgsql: Fix race condition that lead to WALInsertLock deadlock with comm

2015-08-02 Thread Heikki Linnakangas
Fix race condition that lead to WALInsertLock deadlock with commit_delay. If a call to WaitForXLogInsertionsToFinish() returned a value in the middle of a page, and another backend then started to insert a record to the same page, and then you called WaitXLogInsertionsToFinish() again, the second

[COMMITTERS] pgsql: Fix incorrect order of lock file removal and failure to close()

2015-08-02 Thread Tom Lane
Fix incorrect order of lock file removal and failure to close() sockets. Commit c9b0cbe98bd783e24a8c4d8d8ac472a494b81292 accidentally broke the order of operations during postmaster shutdown: it resulted in removing the per-socket lockfiles after, not before, postmaster.pid. This creates a race-c

[COMMITTERS] pgsql: Fix incorrect order of lock file removal and failure to close()

2015-08-02 Thread Tom Lane
Fix incorrect order of lock file removal and failure to close() sockets. Commit c9b0cbe98bd783e24a8c4d8d8ac472a494b81292 accidentally broke the order of operations during postmaster shutdown: it resulted in removing the per-socket lockfiles after, not before, postmaster.pid. This creates a race-c

[COMMITTERS] pgsql: Fix incorrect order of lock file removal and failure to close()

2015-08-02 Thread Tom Lane
Fix incorrect order of lock file removal and failure to close() sockets. Commit c9b0cbe98bd783e24a8c4d8d8ac472a494b81292 accidentally broke the order of operations during postmaster shutdown: it resulted in removing the per-socket lockfiles after, not before, postmaster.pid. This creates a race-c

[COMMITTERS] pgsql: Fix incorrect order of lock file removal and failure to close()

2015-08-02 Thread Tom Lane
Fix incorrect order of lock file removal and failure to close() sockets. Commit c9b0cbe98bd783e24a8c4d8d8ac472a494b81292 accidentally broke the order of operations during postmaster shutdown: it resulted in removing the per-socket lockfiles after, not before, postmaster.pid. This creates a race-c

[COMMITTERS] pgsql: Fix incorrect order of lock file removal and failure to close()

2015-08-02 Thread Tom Lane
Fix incorrect order of lock file removal and failure to close() sockets. Commit c9b0cbe98bd783e24a8c4d8d8ac472a494b81292 accidentally broke the order of operations during postmaster shutdown: it resulted in removing the per-socket lockfiles after, not before, postmaster.pid. This creates a race-c

[COMMITTERS] pgsql: Fix incorrect order of lock file removal and failure to close()

2015-08-02 Thread Tom Lane
Fix incorrect order of lock file removal and failure to close() sockets. Commit c9b0cbe98bd783e24a8c4d8d8ac472a494b81292 accidentally broke the order of operations during postmaster shutdown: it resulted in removing the per-socket lockfiles after, not before, postmaster.pid. This creates a race-c

[COMMITTERS] pgsql: Fix incorrect order of lock file removal and failure to close()

2015-08-02 Thread Tom Lane
Fix incorrect order of lock file removal and failure to close() sockets. Commit c9b0cbe98bd783e24a8c4d8d8ac472a494b81292 accidentally broke the order of operations during postmaster shutdown: it resulted in removing the per-socket lockfiles after, not before, postmaster.pid. This creates a race-c

[COMMITTERS] pgsql: Fix output of ISBN-13 numbers beginning with 979.

2015-08-02 Thread Heikki Linnakangas
Fix output of ISBN-13 numbers beginning with 979. An EAN beginning with 979 (but not 9790 - those are ISMN's) are accepted as ISBN numbers, but they cannot be represented in the old, 10-digit ISBN format. They must be output in the new 13-digit ISBN-13 format. We printed out an incorrect value for

[COMMITTERS] pgsql: Fix output of ISBN-13 numbers beginning with 979.

2015-08-02 Thread Heikki Linnakangas
Fix output of ISBN-13 numbers beginning with 979. An EAN beginning with 979 (but not 9790 - those are ISMN's) are accepted as ISBN numbers, but they cannot be represented in the old, 10-digit ISBN format. They must be output in the new 13-digit ISBN-13 format. We printed out an incorrect value for

[COMMITTERS] pgsql: Fix output of ISBN-13 numbers beginning with 979.

2015-08-02 Thread Heikki Linnakangas
Fix output of ISBN-13 numbers beginning with 979. An EAN beginning with 979 (but not 9790 - those are ISMN's) are accepted as ISBN numbers, but they cannot be represented in the old, 10-digit ISBN format. They must be output in the new 13-digit ISBN-13 format. We printed out an incorrect value for

[COMMITTERS] pgsql: Fix output of ISBN-13 numbers beginning with 979.

2015-08-02 Thread Heikki Linnakangas
Fix output of ISBN-13 numbers beginning with 979. An EAN beginning with 979 (but not 9790 - those are ISMN's) are accepted as ISBN numbers, but they cannot be represented in the old, 10-digit ISBN format. They must be output in the new 13-digit ISBN-13 format. We printed out an incorrect value for

[COMMITTERS] pgsql: Fix output of ISBN-13 numbers beginning with 979.

2015-08-02 Thread Heikki Linnakangas
Fix output of ISBN-13 numbers beginning with 979. An EAN beginning with 979 (but not 9790 - those are ISMN's) are accepted as ISBN numbers, but they cannot be represented in the old, 10-digit ISBN format. They must be output in the new 13-digit ISBN-13 format. We printed out an incorrect value for

[COMMITTERS] pgsql: Fix output of ISBN-13 numbers beginning with 979.

2015-08-02 Thread Heikki Linnakangas
Fix output of ISBN-13 numbers beginning with 979. An EAN beginning with 979 (but not 9790 - those are ISMN's) are accepted as ISBN numbers, but they cannot be represented in the old, 10-digit ISBN format. They must be output in the new 13-digit ISBN-13 format. We printed out an incorrect value for

[COMMITTERS] pgsql: Avoid calling memcpy() with a NULL source pointer and count == 0

2015-08-02 Thread Tom Lane
Avoid calling memcpy() with a NULL source pointer and count == 0. As in commit 0a52d378b03b7d5a, avoid doing something that has undefined results according to the C standard, even though in practice there does not seem to be any problem with it. This fixes two places in numeric.c that demonstrabl

[COMMITTERS] pgsql: Avoid calling memcpy() with a NULL source pointer and count == 0

2015-08-02 Thread Tom Lane
Avoid calling memcpy() with a NULL source pointer and count == 0. As in commit 0a52d378b03b7d5a, avoid doing something that has undefined results according to the C standard, even though in practice there does not seem to be any problem with it. This fixes two places in numeric.c that demonstrabl

Re: [COMMITTERS] Taint mode in PL/Perl

2015-08-02 Thread Andrew Dunstan
On 08/02/2015 12:41 PM, Terry Scheingeld wrote: I've googled and read documentation but I can't figure this out. How do I configure Postgres so that PL/Perl runs in taint mode? I understand that plperl runs in "safe mode" but that's not quite the same thing as taint mode. I do know that it's no

Re: [COMMITTERS] pgsql: Replace our hacked version of ax_pthread.m4 with latest upstream

2015-08-02 Thread Tom Lane
Heikki Linnakangas writes: > I went through the results, and I believe the script is working the way > we want now. Attached is a trimmed result set, where I have removed all > the animals where there was no change in the PTHREAD_CFLAGS value chosen > between the three versions (configlogs-trim

Re: [COMMITTERS] Taint mode in PL/Perl

2015-08-02 Thread Terry Scheingeld
Mea culpa. I'll post as you suggest. I posted to pgsql-committers because that's where I found most of the questions about PL/Perl: http://www.postgresql.org/search/?m=1&q=PL%2FPerl On Sun, Aug 2, 2015 at 3:53 PM, Andrew Dunstan wrote: > > On 08/02/2015 12:41 PM, Terry Scheingeld wrote: >> >> I'

[COMMITTERS] pgsql: Allow TAP tests to run under Msys

2015-08-02 Thread Andrew Dunstan
Allow TAP tests to run under Msys The Msys DTK perl, which is required to run TAP tests under Msys as a native perl won't recognize the correct virtual paths, has its osname recorded in the Config module as 'msys' instead of 'MSWin32'. To avoid having to repeat the test a variable is created that

[COMMITTERS] pgsql: Fix a number of places that produced XX000 errors in the regress

2015-08-02 Thread Tom Lane
Fix a number of places that produced XX000 errors in the regression tests. It's against project policy to use elog() for user-facing errors, or to omit an errcode() selection for errors that aren't supposed to be "can't happen" cases. Fix all the violations of this policy that result in ERRCODE_I

[COMMITTERS] pgsql: Fix a number of places that produced XX000 errors in the regress

2015-08-02 Thread Tom Lane
Fix a number of places that produced XX000 errors in the regression tests. It's against project policy to use elog() for user-facing errors, or to omit an errcode() selection for errors that aren't supposed to be "can't happen" cases. Fix all the violations of this policy that result in ERRCODE_I

[COMMITTERS] pgsql: contrib/isn now needs a .gitignore file.

2015-08-02 Thread Tom Lane
contrib/isn now needs a .gitignore file. Oversight in commit cb3384a0cb4cf900622b77865f60e31259923079. Back-patch to 9.1, like that commit. Branch -- REL9_1_STABLE Details --- http://git.postgresql.org/pg/commitdiff/1e1bb203bcfdb90ef81e97169812a5f5f942b124 Modified Files --

[COMMITTERS] pgsql: contrib/isn now needs a .gitignore file.

2015-08-02 Thread Tom Lane
contrib/isn now needs a .gitignore file. Oversight in commit cb3384a0cb4cf900622b77865f60e31259923079. Back-patch to 9.1, like that commit. Branch -- REL9_3_STABLE Details --- http://git.postgresql.org/pg/commitdiff/bd8f768926f7eed520ba30bc135018ec24e0dd91 Modified Files --

[COMMITTERS] pgsql: contrib/isn now needs a .gitignore file.

2015-08-02 Thread Tom Lane
contrib/isn now needs a .gitignore file. Oversight in commit cb3384a0cb4cf900622b77865f60e31259923079. Back-patch to 9.1, like that commit. Branch -- REL9_4_STABLE Details --- http://git.postgresql.org/pg/commitdiff/4424356c033d4f10f7f0d18f2835f219ee09c8c0 Modified Files --

[COMMITTERS] pgsql: contrib/isn now needs a .gitignore file.

2015-08-02 Thread Tom Lane
contrib/isn now needs a .gitignore file. Oversight in commit cb3384a0cb4cf900622b77865f60e31259923079. Back-patch to 9.1, like that commit. Branch -- REL9_5_STABLE Details --- http://git.postgresql.org/pg/commitdiff/61015249259462020629703a4990234c4629cbee Modified Files --

[COMMITTERS] pgsql: contrib/isn now needs a .gitignore file.

2015-08-02 Thread Tom Lane
contrib/isn now needs a .gitignore file. Oversight in commit cb3384a0cb4cf900622b77865f60e31259923079. Back-patch to 9.1, like that commit. Branch -- REL9_2_STABLE Details --- http://git.postgresql.org/pg/commitdiff/121869fe41a73ae4381b4d1342b0f9f114866326 Modified Files --

[COMMITTERS] pgsql: contrib/isn now needs a .gitignore file.

2015-08-02 Thread Tom Lane
contrib/isn now needs a .gitignore file. Oversight in commit cb3384a0cb4cf900622b77865f60e31259923079. Back-patch to 9.1, like that commit. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/fd7ed26c1a2353923be067dd84059f3ce3a5aff4 Modified Files -- contrib

[COMMITTERS] pgsql: Make modules/test_ddl_deparse/.gitignore match its siblings.

2015-08-02 Thread Tom Lane
Make modules/test_ddl_deparse/.gitignore match its siblings. Not sure why /tmp_check/ was omitted from this one, but even if it isn't really needed right now, it's inconsistent not to include it. Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/e2b49db0f0c55196ae336e2

[COMMITTERS] pgsql: Make modules/test_ddl_deparse/.gitignore match its siblings.

2015-08-02 Thread Tom Lane
Make modules/test_ddl_deparse/.gitignore match its siblings. Not sure why /tmp_check/ was omitted from this one, but even if it isn't really needed right now, it's inconsistent not to include it. Branch -- REL9_5_STABLE Details --- http://git.postgresql.org/pg/commitdiff/642ae4ee7dcb9b48