Re: pgsql: Add kqueue(2) support to the WaitEventSet API.

2020-02-19 Thread Michael Paquier
Hi Thomas, On Wed, Feb 05, 2020 at 04:59:10AM +, Thomas Munro wrote: > Add kqueue(2) support to the WaitEventSet API. > > Use kevent(2) to wait for events on the BSD family of operating > systems and macOS. This is similar to the epoll(2) support added > for Linux by commit 98a64d0bd. Worth

Re: pgsql: Clean up some code, comments and docs referring to Windows 2000

2020-02-19 Thread Michael Paquier
On Thu, Feb 20, 2020 at 01:27:53AM -0500, Tom Lane wrote: > We don't have to guess about it too much, we can check the buildfarm. > Of the configure-using animals, it looks like fairywren, gaur, and > jacana are using src/port/getaddrinfo.c. gaur's excuse is that its > libc is pre-IPv6 ;-) ... Oh

Re: pgsql: Clean up some code, comments and docs referring to Windows 2000

2020-02-19 Thread Tom Lane
Michael Paquier writes: > For the note, it looks that we could get completely rid of > src/port/getaddrinfo.c once we drop support for XP as IPv6 support is > enabled by default on Vista and Windows 7. For XP, one needs to > install an extra module manually. Do you think that there are other > p

Re: pgsql: Clean up some code, comments and docs referring to Windows 2000

2020-02-19 Thread Michael Paquier
On Wed, Feb 19, 2020 at 04:01:54PM -0500, Tom Lane wrote: > Surely this patch broke the error case in haveNativeWindowsIPv6routines()? > That is, in the admittedly unlikely case that LoadLibraryA("ws2_32") > succeeds but GetProcAddress(hLibrary, "getaddrinfo") doesn't, what you > now have will do F

pgsql: Cleanup more code related to ws2_32.dll loading in src/port/geta

2020-02-19 Thread Michael Paquier
Cleanup more code related to ws2_32.dll loading in src/port/getaddrinfo.c e2e0219 has removed a code path for Windows 2000 that attempts to load wship6.dll as fallback if ws2_32.dll is found but not getaddrinfo(), leaving behind a dangling pointer as the library is freed. However, there is no poi

pgsql: Doc: discourage use of partial indexes for poor-man's-partitioni

2020-02-19 Thread Tom Lane
Doc: discourage use of partial indexes for poor-man's-partitioning. Creating a bunch of non-overlapping partial indexes is generally a bad idea, so add an example saying not to do that. Back-patch to v10. Before that, the alternative of using (real) partitioning wasn't available, so that the tra

pgsql: Doc: discourage use of partial indexes for poor-man's-partitioni

2020-02-19 Thread Tom Lane
Doc: discourage use of partial indexes for poor-man's-partitioning. Creating a bunch of non-overlapping partial indexes is generally a bad idea, so add an example saying not to do that. Back-patch to v10. Before that, the alternative of using (real) partitioning wasn't available, so that the tra

pgsql: Doc: discourage use of partial indexes for poor-man's-partitioni

2020-02-19 Thread Tom Lane
Doc: discourage use of partial indexes for poor-man's-partitioning. Creating a bunch of non-overlapping partial indexes is generally a bad idea, so add an example saying not to do that. Back-patch to v10. Before that, the alternative of using (real) partitioning wasn't available, so that the tra

pgsql: Doc: discourage use of partial indexes for poor-man's-partitioni

2020-02-19 Thread Tom Lane
Doc: discourage use of partial indexes for poor-man's-partitioning. Creating a bunch of non-overlapping partial indexes is generally a bad idea, so add an example saying not to do that. Back-patch to v10. Before that, the alternative of using (real) partitioning wasn't available, so that the tra

pgsql: Remove support for upgrading extensions from "unpackaged" state.

2020-02-19 Thread Tom Lane
Remove support for upgrading extensions from "unpackaged" state. Andres Freund pointed out that allowing non-superusers to run "CREATE EXTENSION ... FROM unpackaged" has security risks, since the unpackaged-to-1.0 scripts don't try to verify that the existing objects they're modifying are what the

Re: pgsql: Clean up some code, comments and docs referring to Windows 2000

2020-02-19 Thread Tom Lane
Michael Paquier writes: > Clean up some code, comments and docs referring to Windows 2000 and older Surely this patch broke the error case in haveNativeWindowsIPv6routines()? That is, in the admittedly unlikely case that LoadLibraryA("ws2_32") succeeds but GetProcAddress(hLibrary, "getaddrinfo")

pgsql: Fix typo

2020-02-19 Thread Peter Eisentraut
Fix typo Reported-by: Daniel Verite Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7d8346b2f42fc7311ccac08870c21a9763c43824 Modified Files -- src/common/unicode_norm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo

2020-02-19 Thread Peter Eisentraut
Fix typo Reported-by: Daniel Verite Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/09e40f2b68e1a04d7d0bb0e91f56df0d64b21786 Modified Files -- src/common/unicode_norm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo

2020-02-19 Thread Peter Eisentraut
Fix typo Reported-by: Daniel Verite Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c987c9d42bc698fb2930280d46d191a50abe68f1 Modified Files -- src/common/unicode_norm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo

2020-02-19 Thread Peter Eisentraut
Fix typo Reported-by: Daniel Verite Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2f9c46a32b43d72c9384378827ee51fde896807c Modified Files -- src/common/unicode_norm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix confusion about event trigger vs. plain function in plpgsql.

2020-02-19 Thread Tom Lane
Fix confusion about event trigger vs. plain function in plpgsql. The function hash table keys made by compute_function_hashkey() failed to distinguish event-trigger call context from regular call context. This meant that once we'd successfully made a hash entry for an event trigger (either by vali

pgsql: Fix confusion about event trigger vs. plain function in plpgsql.

2020-02-19 Thread Tom Lane
Fix confusion about event trigger vs. plain function in plpgsql. The function hash table keys made by compute_function_hashkey() failed to distinguish event-trigger call context from regular call context. This meant that once we'd successfully made a hash entry for an event trigger (either by vali

pgsql: Fix confusion about event trigger vs. plain function in plpgsql.

2020-02-19 Thread Tom Lane
Fix confusion about event trigger vs. plain function in plpgsql. The function hash table keys made by compute_function_hashkey() failed to distinguish event-trigger call context from regular call context. This meant that once we'd successfully made a hash entry for an event trigger (either by vali

pgsql: Fix confusion about event trigger vs. plain function in plpgsql.

2020-02-19 Thread Tom Lane
Fix confusion about event trigger vs. plain function in plpgsql. The function hash table keys made by compute_function_hashkey() failed to distinguish event-trigger call context from regular call context. This meant that once we'd successfully made a hash entry for an event trigger (either by vali

pgsql: Fix confusion about event trigger vs. plain function in plpgsql.

2020-02-19 Thread Tom Lane
Fix confusion about event trigger vs. plain function in plpgsql. The function hash table keys made by compute_function_hashkey() failed to distinguish event-trigger call context from regular call context. This meant that once we'd successfully made a hash entry for an event trigger (either by vali

pgsql: Fix confusion about event trigger vs. plain function in plpgsql.

2020-02-19 Thread Tom Lane
Fix confusion about event trigger vs. plain function in plpgsql. The function hash table keys made by compute_function_hashkey() failed to distinguish event-trigger call context from regular call context. This meant that once we'd successfully made a hash entry for an event trigger (either by vali

pgsql: Set gen_random_uuid() to volatile

2020-02-19 Thread Peter Eisentraut
Set gen_random_uuid() to volatile It was set to immutable. This was a mistake in the initial commit (5925e5549890416bcf588334d9d0bc99f8ad6c7f). Reported-by: hubert depesz lubaczewski Discussion: https://www.postgresql.org/message-id/flat/20200218185452.GA8710%40depesz.com Branch -- master

pgsql: Minor refactor of nodeAgg.c.

2020-02-19 Thread Jeff Davis
Minor refactor of nodeAgg.c. * Separate calculation of hash value from the lookup. * Split build_hash_table() into two functions. * Change lookup_hash_entry() to return AggStatePerGroup. That's all the caller needed, anyway. These changes are to support the upcoming Disk-based Hash Aggr

pgsql: logtape.c: allocate read buffer even for an empty tape.

2020-02-19 Thread Jeff Davis
logtape.c: allocate read buffer even for an empty tape. Prior to this commit, the read buffer was allocated at the time the tape was rewound; but as an optimization, would not be allocated at all if the tape was empty. That optimization meant that it was valid to have a rewound tape with the buff

pgsql: Fix mesurement of elapsed time during truncating heap in VACUUM.

2020-02-19 Thread Fujii Masao
Fix mesurement of elapsed time during truncating heap in VACUUM. VACUUM may truncate heap in several batches. The activity report is logged for each batch, and contains the number of pages in the table before and after the truncation, and also the elapsed time during the truncation. Previously the

pgsql: Fix mesurement of elapsed time during truncating heap in VACUUM.

2020-02-19 Thread Fujii Masao
Fix mesurement of elapsed time during truncating heap in VACUUM. VACUUM may truncate heap in several batches. The activity report is logged for each batch, and contains the number of pages in the table before and after the truncation, and also the elapsed time during the truncation. Previously the

pgsql: Fix mesurement of elapsed time during truncating heap in VACUUM.

2020-02-19 Thread Fujii Masao
Fix mesurement of elapsed time during truncating heap in VACUUM. VACUUM may truncate heap in several batches. The activity report is logged for each batch, and contains the number of pages in the table before and after the truncation, and also the elapsed time during the truncation. Previously the

pgsql: Fix mesurement of elapsed time during truncating heap in VACUUM.

2020-02-19 Thread Fujii Masao
Fix mesurement of elapsed time during truncating heap in VACUUM. VACUUM may truncate heap in several batches. The activity report is logged for each batch, and contains the number of pages in the table before and after the truncation, and also the elapsed time during the truncation. Previously the

pgsql: Fix mesurement of elapsed time during truncating heap in VACUUM.

2020-02-19 Thread Fujii Masao
Fix mesurement of elapsed time during truncating heap in VACUUM. VACUUM may truncate heap in several batches. The activity report is logged for each batch, and contains the number of pages in the table before and after the truncation, and also the elapsed time during the truncation. Previously the

pgsql: Fix mesurement of elapsed time during truncating heap in VACUUM.

2020-02-19 Thread Fujii Masao
Fix mesurement of elapsed time during truncating heap in VACUUM. VACUUM may truncate heap in several batches. The activity report is logged for each batch, and contains the number of pages in the table before and after the truncation, and also the elapsed time during the truncation. Previously the