pgsql: Use 64 bit type for BufFileSize().

2018-11-14 Thread Thomas Munro
those platforms anyway, so just fix it. Defect in 9da0cc35. Bug #15460. Back-patch to 11, where this function landed. Author: Thomas Munro Reported-by: Paul van der Linden, Pavel Oskin Reviewed-by: Peter Geoghegan Discussion: https://postgr.es/m/15460-b6db80de822fa0ad%40postgresql.org Discussion: ht

pgsql: Fix const correctness warning.

2018-11-12 Thread Thomas Munro
Fix const correctness warning. Per buildfarm. Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/f43e679b533cab0f26adbca8d54585b94889ce80 Modified Files -- src/backend/libpq/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix const correctness warning.

2018-11-12 Thread Thomas Munro
Fix const correctness warning. Per buildfarm. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b59d4d6c36e14ba4097fa8dac3d31ca86f7f507d Modified Files -- src/backend/libpq/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: pgsql: Fix handling of HBA ldapserver with multiple hostnames.

2018-11-12 Thread Thomas Munro
On Tue, Nov 13, 2018 at 6:54 PM Tom Lane wrote: > Thomas Munro writes: > > Thanks, fixing. Embarassingly, I had turned off -Werror for this > > because my Mac spews strange warnings when you use OpenLDAP, a problem > > to which there must be a better solution. > >

Re: pgsql: Fix handling of HBA ldapserver with multiple hostnames.

2018-11-12 Thread Thomas Munro
On Tue, Nov 13, 2018 at 6:37 PM Tom Lane wrote: > Thomas Munro writes: > > Fix handling of HBA ldapserver with multiple hostnames. > > longfin thinks this has a problem with const-ness: > > auth.c:2380:10: error: passing 'const char *' to parameter of type

pgsql: Fix handling of HBA ldapserver with multiple hostnames.

2018-11-12 Thread Thomas Munro
bug report #15495. Author: Thomas Munro Reported-by: Renaud Navarro Discussion: https://postgr.es/m/15495-2c39fc196c95cd72%40postgresql.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/257ef3cd4fec7ca1213f31b660486b492b1c7031 Modified Files -- src

pgsql: Fix handling of HBA ldapserver with multiple hostnames.

2018-11-12 Thread Thomas Munro
bug report #15495. Author: Thomas Munro Reported-by: Renaud Navarro Discussion: https://postgr.es/m/15495-2c39fc196c95cd72%40postgresql.org Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/6b6c64a96dea5492448aa98cf24eca9325e80371 Modified Files

pgsql: Fix possible buffer overrun in hba.c.

2018-11-12 Thread Thomas Munro
Fix possible buffer overrun in hba.c. Coverty reports a possible buffer overrun in the code that populates the pg_hba_file_rules view. It may not be a live bug due to restrictions on options that can be used together, but let's increase MAX_HBA_OPTIONS and correct a nearby misleading comment. Ba

pgsql: Fix possible buffer overrun in hba.c.

2018-11-12 Thread Thomas Munro
Fix possible buffer overrun in hba.c. Coverty reports a possible buffer overrun in the code that populates the pg_hba_file_rules view. It may not be a live bug due to restrictions on options that can be used together, but let's increase MAX_HBA_OPTIONS and correct a nearby misleading comment. Ba

pgsql: Fix possible buffer overrun in hba.c.

2018-11-12 Thread Thomas Munro
Fix possible buffer overrun in hba.c. Coverty reports a possible buffer overrun in the code that populates the pg_hba_file_rules view. It may not be a live bug due to restrictions on options that can be used together, but let's increase MAX_HBA_OPTIONS and correct a nearby misleading comment. Ba

pgsql: Remove set-but-unused variable.

2018-11-06 Thread Thomas Munro
Remove set-but-unused variable. Clean-up for commit c24dcd0c. Reported-by: Andrew Dunstan Discussion: https://postgr.es/m/2d52ff4a-5440-f6f1-7806-423b0e6370cb%402ndQuadrant.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c4f0876fb8d8f84fc0a6fb6aee91de120718664

Re: pgsql: Use pg_pread() and pg_pwrite() for data files and WAL.

2018-11-06 Thread Thomas Munro
On Wed, Nov 7, 2018 at 11:32 AM Andrew Dunstan wrote: > On 11/6/18 4:01 PM, Thomas Munro wrote: > > Use pg_pread() and pg_pwrite() for data files and WAL. > > > > Cut down on system calls by doing random I/O using offset-based OS > > routines where available. Remov

pgsql: Provide pg_pread() and pg_pwrite() for random I/O.

2018-11-06 Thread Thomas Munro
might inadvertently try to mix pread() and read() on the same file descriptor. Author: Thomas Munro Reviewed-by: Tom Lane, Jesper Pedersen Discussion: https://postgr.es/m/CAEepm=02rapCpPR3ZGF2vW=sbhsdfyo_bz_f-wwwjonma3a...@mail.gmail.com Branch -- master Details --- https://git.postgresql.o

pgsql: Use pg_pread() and pg_pwrite() for data files and WAL.

2018-11-06 Thread Thomas Munro
o provide a new function FileSize() instead. Author: Oskari Saarenmaa, Thomas Munro Reviewed-by: Thomas Munro, Jesper Pedersen, Tom Lane, Alvaro Herrera Discussion: https://postgr.es/m/CAEepm=02rapCpPR3ZGF2vW=sbhsdfyo_bz_f-wwwjonma3a...@mail.gmail.com Discussion: https://postgr.es/m/b8748d39

pgsql: Remove some remaining traces of dsm_resize().

2018-11-06 Thread Thomas Munro
Remove some remaining traces of dsm_resize(). A couple of obsolete comments and unreachable blocks remained after commit 3c60d0fa. Discussion: https://postgr.es/m/CAA4eK1%2B%3DyAFUvpFoHXFi_gm8YqmXN-TtkFH%2BVYjvDLS6-SFq-Q%40mail.gmail.com Branch -- master Details --- https://git.postgre

pgsql: Remove dsm_resize() and dsm_remap().

2018-11-05 Thread Thomas Munro
Remove dsm_resize() and dsm_remap(). These interfaces were never used in core, didn't handle failure of posix_fallocate() correctly and weren't supported on all platforms. We agreed to remove them in 12. Author: Thomas Munro Reported-by: Andres Freund Discussion: https://postgr.es/m/

pgsql: Fix NULL handling in multi-batch Parallel Hash Left Join.

2018-11-02 Thread Thomas Munro
Fix NULL handling in multi-batch Parallel Hash Left Join. NULL keys in left joins were skipped when building batch files. Repair, by making the keep_nulls argument to ExecHashGetHashValue() depend on whether this is a left outer join, as we do in other paths. Bug #15475. Thinko in 1804284042e.

pgsql: Fix NULL handling in multi-batch Parallel Hash Left Join.

2018-11-02 Thread Thomas Munro
Fix NULL handling in multi-batch Parallel Hash Left Join. NULL keys in left joins were skipped when building batch files. Repair, by making the keep_nulls argument to ExecHashGetHashValue() depend on whether this is a left outer join, as we do in other paths. Bug #15475. Thinko in 1804284042e.

pgsql: Remove incorrect comment in dshash.c.

2018-10-28 Thread Thomas Munro
Remove incorrect comment in dshash.c. Back-patch to 11. Author: Antonin Houska Discussion: https://postgr.es/m/8726.1540553521%40localhost Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/051a1494bd31fbb743c23d39299da6933847afb5 Modified Files -- src/ba

pgsql: Remove incorrect comment in dshash.c.

2018-10-28 Thread Thomas Munro
Remove incorrect comment in dshash.c. Back-patch to 11. Author: Antonin Houska Discussion: https://postgr.es/m/8726.1540553521%40localhost Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c653cb27b41eb1632e6d88a3efad482a11e45ee2 Modified Files --

pgsql: Refactor pid, random seed and start time initialization.

2018-10-18 Thread Thomas Munro
: Thomas Munro Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CAEepm%3D2eJj_6%3DB%2B2tEpGu2nf1BjthCf9nXXUouYvJJ4C5WSwhg%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/197e4af9d5da180190a0f2be851b095dba57d9cd Modified Files -- src

pgsql: Move the replication lag tracker into heap memory.

2018-10-15 Thread Thomas Munro
Move the replication lag tracker into heap memory. Andres Freund complained about the 128KB of .bss occupied by LagTracker. It's only needed in the walsender process, so allocate it in heap memory there. Author: Thomas Munro Discussion: https://postgr.es/m/20181015200754.7y7zfuzsoux

pgsql: Relax transactional restrictions on ALTER TYPE ... ADD VALUE (re

2018-10-08 Thread Thomas Munro
intainable. Author: Andrew Dunstan and Tom Lane, with parallel query fix by Thomas Munro Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CAEepm%3D0Ei7g6PaNTbcmAh9tCRahQrk%3Dr5ZWLD-jr7hXweYX3yg%40mail.gmail.com Discussion: https://postgr.es/m/4075.1459088427%40sss.pgh.pa.us Branch ---

pgsql: Constify dsa_size_class_map and use a better type.

2018-09-24 Thread Thomas Munro
Constify dsa_size_class_map and use a better type. Author: Mark G Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CAEeOP_Zy_FvVwcAU0UX9nkOhnoR5KN%3D0B6LWX_kv0ZuSc4wbGw%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/64171b32069adcce7f57840143

pgsql: Use size_t consistently in dsa.{ch}.

2018-09-21 Thread Thomas Munro
Use size_t consistently in dsa.{ch}. Takeshi Ideriha complained that there is a mixture of Size and size_t in dsa.c and corresponding header. Let's use size_t. Back-patch to 10 where dsa.c landed, to make future back-patching easy. Discussion: https://postgr.es/m/4E72940DA2BF16479384A86D54D098

pgsql: Use size_t consistently in dsa.{ch}.

2018-09-21 Thread Thomas Munro
Use size_t consistently in dsa.{ch}. Takeshi Ideriha complained that there is a mixture of Size and size_t in dsa.c and corresponding header. Let's use size_t. Back-patch to 10 where dsa.c landed, to make future back-patching easy. Discussion: https://postgr.es/m/4E72940DA2BF16479384A86D54D098

pgsql: Use size_t consistently in dsa.{ch}.

2018-09-21 Thread Thomas Munro
Use size_t consistently in dsa.{ch}. Takeshi Ideriha complained that there is a mixture of Size and size_t in dsa.c and corresponding header. Let's use size_t. Back-patch to 10 where dsa.c landed, to make future back-patching easy. Discussion: https://postgr.es/m/4E72940DA2BF16479384A86D54D098

pgsql: Fix segment_bins corruption in dsa.c.

2018-09-19 Thread Thomas Munro
corrupt the segment_bins lists. The correct protocol requires checking freed_segment_counter after acquiring the area lock and before resolving any index number to a segment. Add the missing checks and an assertion. Back-patch to 10, where dsa.c first arrived. Author: Thomas Munro Reported-by

pgsql: Fix segment_bins corruption in dsa.c.

2018-09-19 Thread Thomas Munro
corrupt the segment_bins lists. The correct protocol requires checking freed_segment_counter after acquiring the area lock and before resolving any index number to a segment. Add the missing checks and an assertion. Back-patch to 10, where dsa.c first arrived. Author: Thomas Munro Reported-by

pgsql: Fix segment_bins corruption in dsa.c.

2018-09-19 Thread Thomas Munro
corrupt the segment_bins lists. The correct protocol requires checking freed_segment_counter after acquiring the area lock and before resolving any index number to a segment. Add the missing checks and an assertion. Back-patch to 10, where dsa.c first arrived. Author: Thomas Munro Reported-by

pgsql: Defer restoration of libraries in parallel workers.

2018-09-19 Thread Thomas Munro
s worked in practice before parallel query came along. So let's make it work. Later commits might add a warning message and eventually an error. Back-patch to 9.6, where parallel query landed. Author: Thomas Munro Reviewed-by: Amit Kapila Reported-by: Kieran McCusker, Jimmy Discuss

pgsql: Defer restoration of libraries in parallel workers.

2018-09-19 Thread Thomas Munro
s worked in practice before parallel query came along. So let's make it work. Later commits might add a warning message and eventually an error. Back-patch to 9.6, where parallel query landed. Author: Thomas Munro Reviewed-by: Amit Kapila Reported-by: Kieran McCusker, Jimmy Discuss

pgsql: Defer restoration of libraries in parallel workers.

2018-09-19 Thread Thomas Munro
s worked in practice before parallel query came along. So let's make it work. Later commits might add a warning message and eventually an error. Back-patch to 9.6, where parallel query landed. Author: Thomas Munro Reviewed-by: Amit Kapila Reported-by: Kieran McCusker, Jimmy Discuss

pgsql: Defer restoration of libraries in parallel workers.

2018-09-19 Thread Thomas Munro
s worked in practice before parallel query came along. So let's make it work. Later commits might add a warning message and eventually an error. Back-patch to 9.6, where parallel query landed. Author: Thomas Munro Reviewed-by: Amit Kapila Reported-by: Kieran McCusker, Jimmy Discuss

pgsql: Allow DSM allocation to be interrupted.

2018-09-18 Thread Thomas Munro
Allow DSM allocation to be interrupted. Chris Travers reported that the startup process can repeatedly try to cancel a backend that is in a posix_fallocate()/EINTR loop and cause it to loop forever. Teach the retry loop to give up if an interrupt is pending. Don't actually check for interrupts i

pgsql: Allow DSM allocation to be interrupted.

2018-09-18 Thread Thomas Munro
Allow DSM allocation to be interrupted. Chris Travers reported that the startup process can repeatedly try to cancel a backend that is in a posix_fallocate()/EINTR loop and cause it to loop forever. Teach the retry loop to give up if an interrupt is pending. Don't actually check for interrupts i

pgsql: Allow DSM allocation to be interrupted.

2018-09-18 Thread Thomas Munro
Allow DSM allocation to be interrupted. Chris Travers reported that the startup process can repeatedly try to cancel a backend that is in a posix_fallocate()/EINTR loop and cause it to loop forever. Teach the retry loop to give up if an interrupt is pending. Don't actually check for interrupts i

pgsql: Allow DSM allocation to be interrupted.

2018-09-18 Thread Thomas Munro
Allow DSM allocation to be interrupted. Chris Travers reported that the startup process can repeatedly try to cancel a backend that is in a posix_fallocate()/EINTR loop and cause it to loop forever. Teach the retry loop to give up if an interrupt is pending. Don't actually check for interrupts i

pgsql: Allow DSM allocation to be interrupted.

2018-09-18 Thread Thomas Munro
Allow DSM allocation to be interrupted. Chris Travers reported that the startup process can repeatedly try to cancel a backend that is in a posix_fallocate()/EINTR loop and cause it to loop forever. Teach the retry loop to give up if an interrupt is pending. Don't actually check for interrupts i

pgsql: Allow DSM allocation to be interrupted.

2018-09-18 Thread Thomas Munro
Allow DSM allocation to be interrupted. Chris Travers reported that the startup process can repeatedly try to cancel a backend that is in a posix_fallocate()/EINTR loop and cause it to loop forever. Teach the retry loop to give up if an interrupt is pending. Don't actually check for interrupts i

pgsql: Add Greek characters to unaccent.rules.

2018-09-01 Thread Thomas Munro
Add Greek characters to unaccent.rules. Author: Tasos Maschalidis Reviewed-by: Michael Paquier, Tom Lane Discussion: https://postgr.es/m/153495048900.1368.11566580687623014380%40wrigleys.postgresql.org Discussion: https://postgr.es/m/VI1PR01MB38537EBD529FE5EE3FE9A5FEB5370%40VI1PR01MB3853.eurprd0

pgsql: Code review for simplehash.h.

2018-08-27 Thread Thomas Munro
used again in the same translation unit. Undefine SH_EQUAL macro where other "parameter" macros are undefined, for the same reason. Author: Thomas Munro Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CAEepm%3D1LdXZ3mMTM8tHt_b%3DK1kREit%3Dp8sikesak%3DkzHHM07Nw%40mail.gmail.com

pgsql: Fix typos.

2018-08-26 Thread Thomas Munro
Fix typos. Author: David Rowley Discussion: https://postgr.es/m/CAKJS1f8du35u5DprpykWvgNEScxapbWYJdHq%2Bz06Wj3Y2KFPbw%40mail.gmail.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/9ca2207990002a2fd594fd7f9776d9d91acba189 Modified Files -- src

pgsql: Fix typos.

2018-08-26 Thread Thomas Munro
Fix typos. Author: David Rowley Discussion: https://postgr.es/m/CAKJS1f8du35u5DprpykWvgNEScxapbWYJdHq%2Bz06Wj3Y2KFPbw%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/18e586741b41713bec31effbde96ccd6da0a4361 Modified Files -- src/backen

pgsql: Wrap long line in postgresql.conf.sample.

2018-08-22 Thread Thomas Munro
Wrap long line in postgresql.conf.sample. Per complaint from Michael Paquier. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/af63926cf577f4c30e43b7651e93e3a5eaa262e0 Modified Files -- src/backend/utils/misc/postgresql.conf.sample | 3 ++- 1 file changed

pgsql: Provide plan_cache_mode options in postgresql.conf.sample.

2018-08-21 Thread Thomas Munro
Provide plan_cache_mode options in postgresql.conf.sample. Author: David Rowley Discussion: https://postgr.es/m/CAKJS1f8YkwojSTSg8YjNYCLCXzx0fR7wBR3Gf%2BrA9_52eoPZKg%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f9fe269ca21808c1f6a3d0d23936fa4eaf

pgsql: Proof-reading for documentation.

2018-08-16 Thread Thomas Munro
Proof-reading for documentation. Somebody accidentally a word. Back-patch to 9.6. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20180816195431.GA23707%40telsasoft.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/dedc6a2bb15d1b62485840ad87190

pgsql: Proof-reading for documentation.

2018-08-16 Thread Thomas Munro
Proof-reading for documentation. Somebody accidentally a word. Back-patch to 9.6. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20180816195431.GA23707%40telsasoft.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/96e98fa2606b2b12805db99196f468152312

pgsql: Proof-reading for documentation.

2018-08-16 Thread Thomas Munro
Proof-reading for documentation. Somebody accidentally a word. Back-patch to 9.6. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20180816195431.GA23707%40telsasoft.com Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/3fe8c13a31bcdd0220c0c0891c2a1

pgsql: Proof-reading for documentation.

2018-08-16 Thread Thomas Munro
Proof-reading for documentation. Somebody accidentally a word. Back-patch to 9.6. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20180816195431.GA23707%40telsasoft.com Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/07b895aef764fe528af57f04d4543

pgsql: Improve comment in GetNewObjectId().

2018-08-15 Thread Thomas Munro
8e18d04d4da, so adjust the wording. Author: Thomas Munro Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CAEepm%3D33JASACeOayr_W3%3DCSjy2jiPxM-k89axu0akFbHdjnjA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

Re: pgsql: Fix bogus loop logic in 013_crash_restart test's pump_until subr

2018-08-12 Thread Thomas Munro
> we've seen in the buildfarm ever since this test went in. I was able > to reproduce the problem on gaur semi-repeatably, and this appears to > fix it. Oh, thank you! Occasional failures fitting this description had been vexing me for a while in the cfbot results. -- Thomas Munro http://www.enterprisedb.com

pgsql: Add missing header include to pmsignal.h.

2018-08-01 Thread Thomas Munro
Add missing header include to pmsignal.h. pmsignal.h uses sig_atomic_t in some builds, but relied on signal.h having been included already. We could include it conditionally but evidently that wouldn't save anything in practice and would add more ugly macros, so let's just include signal.h always

Re: pgsql: Use signals for postmaster death on Linux.

2018-08-01 Thread Thomas Munro
On Thu, Aug 2, 2018 at 8:07 AM, Tom Lane wrote: > Thomas Munro writes: >> Use signals for postmaster death on Linux. > > One or the other of these patches seems to have caused pmsignal.h > to fail to compile standalone: > > ./src/include/storage/pmsignal.h:79: error: expe

pgsql: Pad semaphores to avoid false sharing.

2018-07-24 Thread Thomas Munro
those operating systems. Author: Thomas Munro Reviewed-by: Andres Freund Reported-by: Mithun Cy Tested-by: Mithun Cy, Tom Lane, Thomas Munro Discussion: https://postgr.es/m/CAD__OugYDM3O%2BdyZnnZSbJprSfsGFJcQ1R%3De59T3hcLmDug4_w%40mail.gmail.com Branch -- REL_10_STABLE Details --- https

pgsql: Pad semaphores to avoid false sharing.

2018-07-24 Thread Thomas Munro
those operating systems. Author: Thomas Munro Reviewed-by: Andres Freund Reported-by: Mithun Cy Tested-by: Mithun Cy, Tom Lane, Thomas Munro Discussion: https://postgr.es/m/CAD__OugYDM3O%2BdyZnnZSbJprSfsGFJcQ1R%3De59T3hcLmDug4_w%40mail.gmail.com Branch -- master Details --- https

pgsql: Pad semaphores to avoid false sharing.

2018-07-24 Thread Thomas Munro
those operating systems. Author: Thomas Munro Reviewed-by: Andres Freund Reported-by: Mithun Cy Tested-by: Mithun Cy, Tom Lane, Thomas Munro Discussion: https://postgr.es/m/CAD__OugYDM3O%2BdyZnnZSbJprSfsGFJcQ1R%3De59T3hcLmDug4_w%40mail.gmail.com Branch -- REL_11_STABLE Details --- https

pgsql: Use setproctitle_fast() to update the ps status, if available.

2018-07-23 Thread Thomas Munro
Use setproctitle_fast() to update the ps status, if available. FreeBSD has introduced a faster variant of setproctitle(). Use it, where available. Author: Thomas Munro Discussion: https://postgr.es/m/CAEepm=1wKMTi81uodJ=1KbJAz5WedOg=cr8ewexrufeaxwe...@mail.gmail.com Branch -- master

pgsql: Accept invalidation messages in InitializeSessionUserId().

2018-07-12 Thread Thomas Munro
Accept invalidation messages in InitializeSessionUserId(). If the authentication method modified the system catalogs through a separate database connection (say, to create a new role on the fly), make sure syscache sees the changes before we try to find the user. Author: Thomas Munro Reviewed-by

pgsql: Add pg_dump --on-conflict-do-nothing option.

2018-07-12 Thread Thomas Munro
Add pg_dump --on-conflict-do-nothing option. When dumping INSERT statements, optionally add ON CONFLICT DO NOTHING. Author: Surafel Temesgen Reviewed-by: Takeshi Ideriha, Nico Williams, Dilip Kumar Discussion: https://postgr.es/m/CALAY4q-PQ9cOEzs2%2BQHK5ObfF_4QbmBaYXbZx6BGGN66Q-n8FA%40mail.gmail

pgsql: Use signals for postmaster death on FreeBSD.

2018-07-10 Thread Thomas Munro
Use signals for postmaster death on FreeBSD. Use FreeBSD 11.2's new support for detecting parent process death to make PostmasterIsAlive() very cheap, as was done for Linux in an earlier commit. Author: Thomas Munro Discussion: https://postgr.es/m/7261eb39-0369-f2f4-1bb5-62f3b6083...@i

pgsql: Use signals for postmaster death on Linux.

2018-07-10 Thread Thomas Munro
Use signals for postmaster death on Linux. Linux provides a way to ask for a signal when your parent process dies. Use that to make PostmasterIsAlive() very cheap. Based on a suggestion from Andres Freund. Author: Thomas Munro, Heikki Linnakangas Reviewed-By: Michael Paquier Discussion: https

pgsql: Add PGTYPESchar_free() to avoid cross-module problems on Windows

2018-06-26 Thread Thomas Munro
Add PGTYPESchar_free() to avoid cross-module problems on Windows. On Windows, it is sometimes important for corresponding malloc() and free() calls to be made from the same DLL, since some build options can result in multiple allocators being active at the same time. For that reason we already pr

pgsql: Add PGTYPESchar_free() to avoid cross-module problems on Windows

2018-06-26 Thread Thomas Munro
Add PGTYPESchar_free() to avoid cross-module problems on Windows. On Windows, it is sometimes important for corresponding malloc() and free() calls to be made from the same DLL, since some build options can result in multiple allocators being active at the same time. For that reason we already pr

pgsql: Add PGTYPESchar_free() to avoid cross-module problems on Windows

2018-06-26 Thread Thomas Munro
Add PGTYPESchar_free() to avoid cross-module problems on Windows. On Windows, it is sometimes important for corresponding malloc() and free() calls to be made from the same DLL, since some build options can result in multiple allocators being active at the same time. For that reason we already pr

pgsql: Add PGTYPESchar_free() to avoid cross-module problems on Windows

2018-06-26 Thread Thomas Munro
Add PGTYPESchar_free() to avoid cross-module problems on Windows. On Windows, it is sometimes important for corresponding malloc() and free() calls to be made from the same DLL, since some build options can result in multiple allocators being active at the same time. For that reason we already pr

pgsql: Add PGTYPESchar_free() to avoid cross-module problems on Windows

2018-06-26 Thread Thomas Munro
Add PGTYPESchar_free() to avoid cross-module problems on Windows. On Windows, it is sometimes important for corresponding malloc() and free() calls to be made from the same DLL, since some build options can result in multiple allocators being active at the same time. For that reason we already pr

pgsql: Move RecoveryLockList into a hash table.

2018-06-26 Thread Thomas Munro
done by David Rowley, though this isn't his patch. Back-patch all the way. Author: Thomas Munro Diagnosed-by: David Rowley, Andres Freund Reviewed-by: Andres Freund, Tom Lane, Robert Haas Discussion: https://postgr.es/m/CAEepm%3D1mL0KiQ2KJ4yuPpLGX94a4Ns_W6TL4EGRouxWibu56pA%40mail.gmail.com

pgsql: Move RecoveryLockList into a hash table.

2018-06-26 Thread Thomas Munro
done by David Rowley, though this isn't his patch. Back-patch all the way. Author: Thomas Munro Diagnosed-by: David Rowley, Andres Freund Reviewed-by: Andres Freund, Tom Lane, Robert Haas Discussion: https://postgr.es/m/CAEepm%3D1mL0KiQ2KJ4yuPpLGX94a4Ns_W6TL4EGRouxWibu56pA%40mail.gmail.com

pgsql: Move RecoveryLockList into a hash table.

2018-06-26 Thread Thomas Munro
done by David Rowley, though this isn't his patch. Back-patch all the way. Author: Thomas Munro Diagnosed-by: David Rowley, Andres Freund Reviewed-by: Andres Freund, Tom Lane, Robert Haas Discussion: https://postgr.es/m/CAEepm%3D1mL0KiQ2KJ4yuPpLGX94a4Ns_W6TL4EGRouxWibu56pA%40mail.gmail.com

pgsql: Move RecoveryLockList into a hash table.

2018-06-26 Thread Thomas Munro
done by David Rowley, though this isn't his patch. Back-patch all the way. Author: Thomas Munro Diagnosed-by: David Rowley, Andres Freund Reviewed-by: Andres Freund, Tom Lane, Robert Haas Discussion: https://postgr.es/m/CAEepm%3D1mL0KiQ2KJ4yuPpLGX94a4Ns_W6TL4EGRouxWibu56pA%40mail.gmail.com

pgsql: Move RecoveryLockList into a hash table.

2018-06-26 Thread Thomas Munro
done by David Rowley, though this isn't his patch. Back-patch all the way. Author: Thomas Munro Diagnosed-by: David Rowley, Andres Freund Reviewed-by: Andres Freund, Tom Lane, Robert Haas Discussion: https://postgr.es/m/CAEepm%3D1mL0KiQ2KJ4yuPpLGX94a4Ns_W6TL4EGRouxWibu56pA%40mail.gmail.com

pgsql: Move RecoveryLockList into a hash table.

2018-06-26 Thread Thomas Munro
done by David Rowley, though this isn't his patch. Back-patch all the way. Author: Thomas Munro Diagnosed-by: David Rowley, Andres Freund Reviewed-by: Andres Freund, Tom Lane, Robert Haas Discussion: https://postgr.es/m/CAEepm%3D1mL0KiQ2KJ4yuPpLGX94a4Ns_W6TL4EGRouxWibu56pA%40mail.gmail.com

pgsql: Add PGTYPESchar_free() to avoid cross-module problems on Windows

2018-06-17 Thread Thomas Munro
Add PGTYPESchar_free() to avoid cross-module problems on Windows. On Windows, it is sometimes important for corresponding malloc() and free() calls to be made from the same DLL, since some build options can result in multiple allocators being active at the same time. For that reason we already pr

pgsql: Limit Parallel Hash's bucket array to MaxAllocSize.

2018-06-10 Thread Thomas Munro
ange avoids the error from bug report #15225. Author: Thomas Munro Reviewed-By: Tom Lane Reported-by: Frits Jalvingh Discussion: https://postgr.es/m/152802081668.26724.16985037679312485972%40wrigleys.postgresql.org Branch -- master Details --- https://git.postgresql.or

Re: pgsql: Clone extended stats in CREATE TABLE (LIKE INCLUDING ALL)

2018-03-05 Thread Thomas Munro
terMain (postmaster.c:1365) ==430==by 0x702B56: main (main.c:228) ==430== -- Thomas Munro http://www.enterprisedb.com

Re: [COMMITTERS] pgsql: Remove secondary checkpoint

2018-02-06 Thread Thomas Munro
ast one. -*/ + /* Get the last valid checkpoint record. */ -- Thomas Munro http://www.enterprisedb.com comment.patch Description: Binary data

Re: pgsql: Fix another instance of unsafe coding for shm_toc_lookup failure

2018-02-04 Thread Thomas Munro
On Sat, Feb 3, 2018 at 3:08 PM, Tom Lane wrote: > Thomas Munro writes: >> However, it's not surprising that you drew the >> opposite conclusion (ie that it might in fact not be in the TOC), >> since the shm space is really only necessary for EXPLAIN ANALYZE. >&g

Re: pgsql: Fix another instance of unsafe coding for shm_toc_lookup failure

2018-02-02 Thread Thomas Munro
hat you drew the opposite conclusion (ie that it might in fact not be in the TOC), since the shm space is really only necessary for EXPLAIN ANALYZE. Perhaps I should make it skip setting up this shm stuff if !node->ss.ps.instrument, just like the equivalent Sort node code. I will look into

Re: pgsql: Add parallel-aware hash joins.

2018-01-22 Thread Thomas Munro
On Mon, Jan 22, 2018 at 11:17 PM, Thomas Munro wrote: > It looks to me like longfin's average and > variation increased half way between fa330f9a and 18042840, somewhere > near Dec 7 to 9, when we went from ~40s +/- 1 to ~50s with several > seconds' variation. Was there so

Re: pgsql: Add parallel-aware hash joins.

2018-01-22 Thread Thomas Munro
On Thu, Dec 28, 2017 at 5:26 PM, Tom Lane wrote: > Thomas Munro writes: >> On Thu, Dec 28, 2017 at 3:32 PM, Tom Lane wrote: >>> Aside from the instability problems, I'm pretty unhappy about how much >>> the PHJ patch has added to the runtime of "make check&

Re: pgsql: Improve scripting language in pgbench

2018-01-09 Thread Thomas Munro
n 09 11:49:51 # debug(script=0,command=29): double 1e+030 ... Jan 09 11:49:51 # doesn't match '(?-xism:command=29.: double 1e\+30\b)' I think you need to put "0?" back into the pattern like in the attached. -- Thomas Munro http://www.enterprisedb.com fix.patch Description: Binary data

Re: pgsql: Improve error handling in RemovePgTempFiles().

2018-01-07 Thread Thomas Munro
to open it with my proposal, considering this is code running in the postmaster at startup, so I figured I must be missing something and hadn't got around to figure out what and replying. Thanks for fixing this. -- Thomas Munro http://www.enterprisedb.com

Re: pgsql: Improve error handling in RemovePgTempFiles().

2018-01-06 Thread Thomas Munro
NULL (going against your commit message above), or I suppose we could arrange for temporary directories always to exist in base and each tablespace. -- Thomas Munro http://www.enterprisedb.com quieten-startup.patch Description: Binary data

Re: pgsql: Add parallel-aware hash joins.

2018-01-04 Thread Thomas Munro
rescan (ie workers get restarted repeatedly by the gather node reusing the DSM; maybe I misunderstood some detail of the protocol for that). I'll go and review that code and try to reproduce the failure. On the off-chance, Andrew, is there any chance you have a core dump you could pull a backtrace out of, on brolga? -- Thomas Munro http://www.enterprisedb.com

Re: pgsql: Implement channel binding tls-server-end-point for SCRAM

2018-01-04 Thread Thomas Munro
/backend/libpq/be-secure-openssl.c:1268: undefined reference to `X509_get_signature_nid' -- Thomas Munro http://www.enterprisedb.com

Re: pgsql: Add parallel-aware hash joins.

2018-01-03 Thread Thomas Munro
> failing query from join.sql. We can put it back when there's > reason to think it will pass everywhere. I spent a lot of time trying and failing to get the world's slowest 32 bit powerpc emulation to reproduce this. Bleugh. Before we rip that test out, would you mind checking i

Re: pgsql: Allow ldaps when using ldap authentication

2018-01-03 Thread Thomas Munro
On Thu, Jan 4, 2018 at 9:07 AM, Thomas Munro wrote: > On Thu, Jan 4, 2018 at 4:14 AM, Peter Eisentraut wrote: >> Allow ldaps when using ldap authentication > > Other Windows systems seem OK with this, but baiji said: > > .\src\backend\libpq\auth.c(2538): error C2065: '

Re: pgsql: Allow ldaps when using ldap authentication

2018-01-03 Thread Thomas Munro
posed to come from... -- Thomas Munro http://www.enterprisedb.com

Re: pgsql: Add parallel-aware hash joins.

2018-01-03 Thread Thomas Munro
On Wed, Jan 3, 2018 at 2:38 PM, Tom Lane wrote: > Thomas Munro writes: >> I mean that ExecChooseHashTableSize() estimates the hash table size like >> this: >> inner_rel_bytes = ntuples * tupsize; > >> ... but then at execution time, in the Parallel Hash case,

Re: pgsql: Add parallel-aware hash joins.

2018-01-02 Thread Thomas Munro
s: bucket_bytes = sizeof(HashJoinTuple) * nbuckets; The real size at execution time is sizeof(dsa_pointer_atomic) * nbuckets. I don't think that's responsible for this particular underestimation problem because the bucket array is currently not considered at execution time when deciding to increase batches -- it should be, and I'll come back to those two problems separately. -- Thomas Munro http://www.enterprisedb.com

Re: pgsql: Add parallel-aware hash joins.

2018-01-01 Thread Thomas Munro
mail tomorrow, when I'm back from my break. -- Thomas Munro http://www.enterprisedb.com

Re: pgsql: Add parallel-aware hash joins.

2017-12-30 Thread Thomas Munro
On Sun, Dec 31, 2017 at 11:34 AM, Tom Lane wrote: > Thomas Munro writes: >> You mentioned that prairiedog sees the problem about one time in >> thirty. Would you mind checking if it goes away with this patch >> applied? > > I've run 55 cycles of "make i

Re: pgsql: Add parallel-aware hash joins.

2017-12-30 Thread Thomas Munro
intained when hash chunks and bucket arrays are allocated and freed), but figured we should just go with something super simple for now and then discuss better ideas as a later evolution. >> [code] > > I bet pgindent will not like this layout. pgindented. > Ho hum. Is this really, as you

Re: pgsql: Add parallel-aware hash joins.

2017-12-30 Thread Thomas Munro
On Fri, Dec 29, 2017 at 2:21 AM, Thomas Munro wrote: > On Thu, Dec 28, 2017 at 5:15 PM, Thomas Munro > wrote: >> On Thu, Dec 28, 2017 at 3:32 PM, Tom Lane wrote: >>> !Buckets: 1024 (originally 2048) Batches: 1 >>> (originally 1) Memo

Re: pgsql: Use new overflow aware integer operations.

2017-12-29 Thread Thomas Munro
On Sat, Dec 30, 2017 at 8:43 AM, Andres Freund wrote: > On 2017-12-29 23:06:10 +1300, Thomas Munro wrote: >> On Wed, Dec 13, 2017 at 2:01 PM, Andres Freund wrote: >> > Use new overflow aware integer operations. >> >> frogmouth seems to have crashed in the vicinity o

Re: pgsql: Use new overflow aware integer operations.

2017-12-29 Thread Thomas Munro
: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=frogmouth&dt=2017-12-28%2011%3A30%3A54 -- Thomas Munro http://www.enterprisedb.com

Re: pgsql: Add pow(), aka power(), function to pgbench.

2017-12-29 Thread Thomas Munro
ch '(?^:command=32.: double 1e\+30\b)' The difference seems to be a leading zero before the exponent, so perhaps the patterns need "0*" in there? -- Thomas Munro http://www.enterprisedb.com

Re: pgsql: Add parallel-aware hash joins.

2017-12-28 Thread Thomas Munro
On Thu, Dec 28, 2017 at 5:15 PM, Thomas Munro wrote: > On Thu, Dec 28, 2017 at 3:32 PM, Tom Lane wrote: >> !Buckets: 1024 (originally 2048) Batches: 1 >> (originally 1) Memory Usage: 0kB >> ! Execution time: 243.120 ms >> >>

Re: pgsql: Add parallel-aware hash joins.

2017-12-27 Thread Thomas Munro
On Thu, Dec 28, 2017 at 3:32 PM, Tom Lane wrote: > Thomas Munro writes: >> I'll address the instability of the regression test output separately. > > If you're still looking for data on that --- prairiedog is able to > reproduce the "multibatch = f" variant

<    7   8   9   10   11   12   13   >