[COMMITTERS] pgsql: Fix whitespace

2017-10-11 Thread Peter Eisentraut
Fix whitespace Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e9e0f78bdeaee6e1e24544fd564cf0907f6a2134 Modified Files -- src/test/regress/expected/partition_join.out | 2 +- src/test/regress/sql/partition_join.sql | 2 +- 2 files changed, 2

Re: [COMMITTERS] pgsql: Remove unnecessary PG_TRY overhead for CurrentResourceOwner chan

2017-10-11 Thread Tom Lane
I wrote: > Remove unnecessary PG_TRY overhead for CurrentResourceOwner changes. > Discussion: https://postgr.es/m/5236.1507583...@sss.pgh.pa.us Ooops, copied and pasted the wrong message ID. The correct one is Discussion: https://postgr.es/m/19645.1507568...@sss.pgh.pa.us

[COMMITTERS] pgsql: Allow to avoid NUL-byte management for stringinfos and use in fo

2017-10-11 Thread Andres Freund
Allow to avoid NUL-byte management for stringinfos and use in format.c. In a lot of the places having appendBinaryStringInfo() maintain a trailing NUL byte wasn't actually meaningful, e.g. when appending an integer which can contain 0 in one of its bytes. Removing this yields some small speedup,

[COMMITTERS] pgsql: pg_stat_statements: Widen query IDs from 32 bits to 64 bits.

2017-10-11 Thread Robert Haas
pg_stat_statements: Widen query IDs from 32 bits to 64 bits. This takes advantage of the infrastructure introduced by commit 81c5e46c490e2426db243eada186995da5bb0ba7 to greatly reduce the likelihood that two different queries will end up with the same query ID. It's still possible, of course,

[COMMITTERS] pgsql: Work around overly strict restrict checks by MSVC.

2017-10-11 Thread Andres Freund
Work around overly strict restrict checks by MSVC. Apparently MSVC requires a * before a restrict in a variable declaration, even if the adorned type already is a pointer, just via typedef. As reported by buildfarm animal woodlouse. Author: Andres Freund Discussion:

[COMMITTERS] pgsql: Add configure infrastructure to detect support for C99's restric

2017-10-11 Thread Andres Freund
Add configure infrastructure to detect support for C99's restrict. Will be used in later commits improving performance for a few key routines where information about aliasing allows for significantly better code generation. This allows to use the C99 'restrict' keyword without breaking C89, or

[COMMITTERS] pgsql: Add more efficient functions to pqformat API.

2017-10-11 Thread Andres Freund
Add more efficient functions to pqformat API. There's three prongs to achieve greater efficiency here: 1) Allow reusing a stringbuffer across pq_beginmessage/endmessage, with the new pq_beginmessage_reuse/endmessage_reuse. This can be beneficial both because it avoids allocating the

[COMMITTERS] pgsql: Use one stringbuffer for all rows printed in printtup.c.

2017-10-11 Thread Andres Freund
Use one stringbuffer for all rows printed in printtup.c. This avoids newly allocating, and then possibly growing, the stringbuffer for every row. For wide rows this can substantially reduce memory allocator overhead, at the price of not immediately reducing memory usage after outputting an

Re: [COMMITTERS] pgsql: Add configure infrastructure to detect support for C99's restric

2017-10-11 Thread Andres Freund
Hi, On 2017-10-11 23:11:15 +, Andres Freund wrote: > Add configure infrastructure to detect support for C99's restrict. > > Will be used in later commits improving performance for a few key > routines where information about aliasing allows for significantly > better code generation. > >

[COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2017-10-11 Thread Andres Freund
Improve performance of SendRowDescriptionMessage. There's three categories of changes leading to better performance: - Splitting the per-attribute part of SendRowDescriptionMessage into a v2 and a v3 version allows avoiding branches for every attribute. - Preallocating the size of the buffer to

[COMMITTERS] pgsql: Doc: fix missing explanation of default object privileges.

2017-10-11 Thread Tom Lane
Doc: fix missing explanation of default object privileges. The GRANT reference page, which lists the default privileges for new objects, failed to mention that USAGE is granted by default for data types and domains. As a lesser sin, it also did not specify anything about the initial privileges

[COMMITTERS] pgsql: Doc: fix missing explanation of default object privileges.

2017-10-11 Thread Tom Lane
Doc: fix missing explanation of default object privileges. The GRANT reference page, which lists the default privileges for new objects, failed to mention that USAGE is granted by default for data types and domains. As a lesser sin, it also did not specify anything about the initial privileges

[COMMITTERS] pgsql: Doc: fix missing explanation of default object privileges.

2017-10-11 Thread Tom Lane
Doc: fix missing explanation of default object privileges. The GRANT reference page, which lists the default privileges for new objects, failed to mention that USAGE is granted by default for data types and domains. As a lesser sin, it also did not specify anything about the initial privileges

[COMMITTERS] pgsql: Prevent idle in transaction session timeout from sometimes being

2017-10-11 Thread Andres Freund
Prevent idle in transaction session timeout from sometimes being ignored. The previous coding in ProcessInterrupts() could lead to idle_in_transaction_session_timeout being ignored, when statement_timeout occurred earlier. The problem was that ProcessInterrupts() would return before processing

[COMMITTERS] pgsql: Prevent idle in transaction session timeout from sometimes being

2017-10-11 Thread Andres Freund
Prevent idle in transaction session timeout from sometimes being ignored. The previous coding in ProcessInterrupts() could lead to idle_in_transaction_session_timeout being ignored, when statement_timeout occurred earlier. The problem was that ProcessInterrupts() would return before processing

[COMMITTERS] pgsql: Prevent idle in transaction session timeout from sometimes being

2017-10-11 Thread Andres Freund
Prevent idle in transaction session timeout from sometimes being ignored. The previous coding in ProcessInterrupts() could lead to idle_in_transaction_session_timeout being ignored, when statement_timeout occurred earlier. The problem was that ProcessInterrupts() would return before processing

[COMMITTERS] pgsql: Doc: fix missing explanation of default object privileges.

2017-10-11 Thread Tom Lane
Doc: fix missing explanation of default object privileges. The GRANT reference page, which lists the default privileges for new objects, failed to mention that USAGE is granted by default for data types and domains. As a lesser sin, it also did not specify anything about the initial privileges

[COMMITTERS] pgsql: Doc: fix missing explanation of default object privileges.

2017-10-11 Thread Tom Lane
Doc: fix missing explanation of default object privileges. The GRANT reference page, which lists the default privileges for new objects, failed to mention that USAGE is granted by default for data types and domains. As a lesser sin, it also did not specify anything about the initial privileges

[COMMITTERS] pgsql: Doc: fix missing explanation of default object privileges.

2017-10-11 Thread Tom Lane
Doc: fix missing explanation of default object privileges. The GRANT reference page, which lists the default privileges for new objects, failed to mention that USAGE is granted by default for data types and domains. As a lesser sin, it also did not specify anything about the initial privileges

[COMMITTERS] pgsql: Doc: fix missing explanation of default object privileges.

2017-10-11 Thread Tom Lane
Doc: fix missing explanation of default object privileges. The GRANT reference page, which lists the default privileges for new objects, failed to mention that USAGE is granted by default for data types and domains. As a lesser sin, it also did not specify anything about the initial privileges

[COMMITTERS] pgsql: Remove unnecessary PG_TRY overhead for CurrentResourceOwner chan

2017-10-11 Thread Tom Lane
Remove unnecessary PG_TRY overhead for CurrentResourceOwner changes. resowner/README contained advice to use a PG_TRY block to restore the old CurrentResourceOwner value anywhere that that variable is transiently changed. That advice was only inconsistently followed, however, and on reflection

[COMMITTERS] pgsql: Add port/strnlen support to libpq and ecpg Makefiles.

2017-10-11 Thread Tom Lane
Add port/strnlen support to libpq and ecpg Makefiles. In the wake of fffd651e8, any makefile that pulls in snprintf.c from src/port/ needs to be prepared to pull in strnlen.c as well. Per buildfarm. Branch -- master Details ---

[COMMITTERS] pgsql: Temporary attempt at a workaround for further MSVC restrict buil

2017-10-11 Thread Andres Freund
Temporary attempt at a workaround for further MSVC restrict build failures. It appears some versions of msvc use __declspec(restrict) in stdlib.h and subsidiary headers. Including those after defining 'restrict' to '__restrict' doesn't work. Try to get the buildfarm green to see whether there's

[COMMITTERS] pgsql: Prevent sharing transition states between ordered-set aggregates

2017-10-11 Thread Tom Lane
Prevent sharing transition states between ordered-set aggregates. This ought to work, but the built-in OSAs are not capable of coping, because their final-functions destructively modify their transition state (specifically, the contained tuplesort object). That was fine when those functions were

[COMMITTERS] pgsql: Prevent sharing transition states between ordered-set aggregates

2017-10-11 Thread Tom Lane
Prevent sharing transition states between ordered-set aggregates. This ought to work, but the built-in OSAs are not capable of coping, because their final-functions destructively modify their transition state (specifically, the contained tuplesort object). That was fine when those functions were

[COMMITTERS] pgsql: Prevent sharing transition states between ordered-set aggregates

2017-10-11 Thread Tom Lane
Prevent sharing transition states between ordered-set aggregates. This ought to work, but the built-in OSAs are not capable of coping, because their final-functions destructively modify their transition state (specifically, the contained tuplesort object). That was fine when those functions were

[COMMITTERS] pgsql: Replace remaining uses of pq_sendint with pq_sendint{8, 16, 32}.

2017-10-11 Thread Andres Freund
Replace remaining uses of pq_sendint with pq_sendint{8,16,32}. pq_sendint() remains, so extension code doesn't unnecessarily break. Author: Andres Freund Discussion: https://postgr.es/m/20170914063418.sckdzgjfrsbek...@alap3.anarazel.de Branch -- master Details ---

Re: [HACKERS] Re: [COMMITTERS] pgsql: Add configure infrastructure to detect support for C99's restric

2017-10-11 Thread Andres Freund
On 2017-10-11 21:59:53 -0700, Andres Freund wrote: > That fixed that problem I think. But unfortunately since then another > problem has been reported by some other animals, all with older msvc > versions afaict (thrips - vs 2012, bowerbird - vs 2012). Correction, thrips is vs 2010, not 2012.

Re: [COMMITTERS] pgsql: Add configure infrastructure to detect support for C99's restric

2017-10-11 Thread Andres Freund
On 2017-10-11 17:13:20 -0700, Andres Freund wrote: > Hi, > > On 2017-10-11 23:11:15 +, Andres Freund wrote: > > Add configure infrastructure to detect support for C99's restrict. > > > > Will be used in later commits improving performance for a few key > > routines where information about

Re: [COMMITTERS] pgsql: Add port/strnlen support to libpq and ecpg Makefiles.

2017-10-11 Thread Andres Freund
On 2017-10-11 15:28:16 +, Tom Lane wrote: > Add port/strnlen support to libpq and ecpg Makefiles. > > In the wake of fffd651e8, any makefile that pulls in snprintf.c > from src/port/ needs to be prepared to pull in strnlen.c as well. > Per buildfarm. Thanks. > Modified Files >

Re: [COMMITTERS] pgsql: Add port/strnlen support to libpq and ecpg Makefiles.

2017-10-11 Thread Tom Lane
Andres Freund writes: > Phew. This is a bit a sad state of affairs. The separate libpq logic for > getting pgport is presumably because of possibly different threading > flags and then because of the appropriate compiler/linker flags for a > shared library? I don't see why

Re: [COMMITTERS] pgsql: Add port/strnlen support to libpq and ecpg Makefiles.

2017-10-11 Thread Andres Freund
Hi, On 2017-10-11 11:58:58 -0400, Tom Lane wrote: > Andres Freund writes: > > Phew. This is a bit a sad state of affairs. The separate libpq logic for > > getting pgport is presumably because of possibly different threading > > flags and then because of the appropriate

Re: [COMMITTERS] pgsql: Add port/strnlen support to libpq and ecpg Makefiles.

2017-10-11 Thread Tom Lane
Andres Freund writes: > On 2017-10-11 11:58:58 -0400, Tom Lane wrote: >> I agree the PITA factor of the current approach keeps increasing. >> It sounds a bit silly to build libpgport three ways, but maybe >> we should just do that. > We already kinda are, just by copying

[COMMITTERS] pgsql: Fix low-probability loss of NOTIFY messages due to XID wraparoun

2017-10-11 Thread Tom Lane
Fix low-probability loss of NOTIFY messages due to XID wraparound. Up to now async.c has used TransactionIdIsInProgress() to detect whether a notify message's source transaction is still running. However, that function has a quick-exit path that reports that XIDs before RecentXmin are no longer

[COMMITTERS] pgsql: Fix low-probability loss of NOTIFY messages due to XID wraparoun

2017-10-11 Thread Tom Lane
Fix low-probability loss of NOTIFY messages due to XID wraparound. Up to now async.c has used TransactionIdIsInProgress() to detect whether a notify message's source transaction is still running. However, that function has a quick-exit path that reports that XIDs before RecentXmin are no longer

[COMMITTERS] pgsql: Fix low-probability loss of NOTIFY messages due to XID wraparoun

2017-10-11 Thread Tom Lane
Fix low-probability loss of NOTIFY messages due to XID wraparound. Up to now async.c has used TransactionIdIsInProgress() to detect whether a notify message's source transaction is still running. However, that function has a quick-exit path that reports that XIDs before RecentXmin are no longer

[COMMITTERS] pgsql: Fix low-probability loss of NOTIFY messages due to XID wraparoun

2017-10-11 Thread Tom Lane
Fix low-probability loss of NOTIFY messages due to XID wraparound. Up to now async.c has used TransactionIdIsInProgress() to detect whether a notify message's source transaction is still running. However, that function has a quick-exit path that reports that XIDs before RecentXmin are no longer

[COMMITTERS] pgsql: Fix low-probability loss of NOTIFY messages due to XID wraparoun

2017-10-11 Thread Tom Lane
Fix low-probability loss of NOTIFY messages due to XID wraparound. Up to now async.c has used TransactionIdIsInProgress() to detect whether a notify message's source transaction is still running. However, that function has a quick-exit path that reports that XIDs before RecentXmin are no longer

[COMMITTERS] pgsql: Fix low-probability loss of NOTIFY messages due to XID wraparoun

2017-10-11 Thread Tom Lane
Fix low-probability loss of NOTIFY messages due to XID wraparound. Up to now async.c has used TransactionIdIsInProgress() to detect whether a notify message's source transaction is still running. However, that function has a quick-exit path that reports that XIDs before RecentXmin are no longer

[COMMITTERS] pgsql: Fix low-probability loss of NOTIFY messages due to XID wraparoun

2017-10-11 Thread Tom Lane
Fix low-probability loss of NOTIFY messages due to XID wraparound. Up to now async.c has used TransactionIdIsInProgress() to detect whether a notify message's source transaction is still running. However, that function has a quick-exit path that reports that XIDs before RecentXmin are no longer

[COMMITTERS] pgsql: Fix mistakes in comments.

2017-10-11 Thread Robert Haas
Fix mistakes in comments. Masahiko Sawada Discussion: http://postgr.es/m/cad21aobsfysmhd6_sl9in3n_foaa+opbl5jg55dxu1chauj...@mail.gmail.com Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/516e29ab6f1f66767a78361dea0392f1530766b6 Modified Files

[COMMITTERS] pgsql: Fix mistakes in comments.

2017-10-11 Thread Robert Haas
Fix mistakes in comments. Masahiko Sawada Discussion: http://postgr.es/m/cad21aobsfysmhd6_sl9in3n_foaa+opbl5jg55dxu1chauj...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/20d210bf5bb0d5ae37c727d364cfd810c367704a Modified Files --