pgsql: Allow NULL version for individual collations.

2020-03-24 Thread Thomas Munro
Allow NULL version for individual collations. Remove the documented restriction that collation providers must either return NULL for all collations or non-NULL for all collations. Use NULL for glibc collations like "C.UTF-8", which might otherwise lead future proposed commits to force unnecessary

pgsql: Add collation versions for Windows.

2020-03-24 Thread Thomas Munro
Add collation versions for Windows. On Vista and later, use GetNLSVersionEx() to request collation version information. Reviewed-by: Juan José Santamaría Flecha Discussion: https://postgr.es/m/CA%2BhUKGJvqup3s%2BJowVTcacZADO6dOhfdBmvOPHLS3KXUJu41Jw%40mail.gmail.com Branch -- master Detail

pgsql: Avoid allocating unnecessary zero-sized array.

2020-03-24 Thread Jeff Davis
Avoid allocating unnecessary zero-sized array. If there are no aggregates, there is no need to allocate an array of zero AggStatePerGroupData elements. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3649133b147638f25933c93e3d4f6b920da50332 Modified Files -

pgsql: Consider disk-based hash aggregation to implement DISTINCT.

2020-03-24 Thread Jeff Davis
Consider disk-based hash aggregation to implement DISTINCT. Correct oversight in 1f39bce0. If enable_hashagg_disk=true, we should consider hash aggregation for DISTINCT when applicable. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/dd8e19132acfbb28d579288a412ed6c0

pgsql: Fix nbtree deduplication README commentary.

2020-03-24 Thread Peter Geoghegan
Fix nbtree deduplication README commentary. Descriptions of some aspects of how deduplication works were unclear in a couple of places. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b150a76793109b00ea43c26e0006b3cad9030096 Modified Files -- src/backen

pgsql: logical decoding: Remove TODO about unnecessary optimization.

2020-03-24 Thread Andres Freund
logical decoding: Remove TODO about unnecessary optimization. Measurements show, and intuition agrees, that there's currently no known cases where adding a fastpath to avoid allocating / ordering a heap for a single transaction is worthwhile. Author: Dilip Kumar Discussion: https://postgr.es/m/C

pgsql: Fix compiler warning on Cygwin

2020-03-24 Thread Peter Eisentraut
Fix compiler warning on Cygwin bf68b79e50e3359accc85c94fa23cc03abb9350a introduced an unused variable compiler warning on Cygwin. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f15ace793578d96d70dad1e613293ae3eab92503 Modified Files -- src/backend/util

pgsql: Improve the internal implementation of ereport().

2020-03-24 Thread Tom Lane
Improve the internal implementation of ereport(). Change all the auxiliary error-reporting routines to return void, now that we no longer need to pretend they are passing something useful to errfinish(). While this probably doesn't save anything significant at the machine-code level, it allows de

pgsql: Re-implement the ereport() macro using __VA_ARGS__.

2020-03-24 Thread Tom Lane
Re-implement the ereport() macro using __VA_ARGS__. Now that we require C99, we can depend on __VA_ARGS__ to work, and revising ereport() to use it has several significant benefits: * The extra parentheses around the auxiliary function calls are now optional. Aside from being a bit less ugly, th

pgsql: Re-implement the ereport() macro using __VA_ARGS__.

2020-03-24 Thread Tom Lane
Re-implement the ereport() macro using __VA_ARGS__. Now that we require C99, we can depend on __VA_ARGS__ to work, and revising ereport() to use it has several significant benefits: * The extra parentheses around the auxiliary function calls are now optional. Aside from being a bit less ugly, th

Re: pgsql: Some refactoring of logical/worker.c

2020-03-24 Thread Peter Eisentraut
On 2020-03-24 15:39, Erik Rijkers wrote: worker.c: In function ‘apply_handle_update_internal’: worker.c:791:22: warning: unused variable ‘remoterel’ [-Wunused-variable] 791 | LogicalRepRelation *remoterel = &relmapentry->remoterel; | fixed -- Peter Eisentraut http://w

pgsql: Fix compiler warning

2020-03-24 Thread Peter Eisentraut
Fix compiler warning A variable was unused in non-assert builds. Simplify the code to avoid the issue. Reported-by: Erik Rijkers Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/cef27ae01ac872355b2bd56c0882aafe5c6f08de Modified Files -- src/backend/re

Re: pgsql: Some refactoring of logical/worker.c

2020-03-24 Thread Erik Rijkers
On 2020-03-24 15:17, Peter Eisentraut wrote: Some refactoring of logical/worker.c Discussion: https://www.postgresql.org/message-id/flat/CA+HiwqH=Y85vRK3mOdjEkqFK+E=ST=eQiHdpj43L=_ejmoo...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/97ee604d9bce

pgsql: Doc: fix broken markup.

2020-03-24 Thread Tom Lane
Doc: fix broken markup. Sloppiness in commit cedffbdb8, noted by Erikjan Rijkers. (It's fairly unfortunate that xmllint doesn't catch this.) Discussion: https://postgr.es/m/2e3dc9e4bfa4802d2c9f5fe15bde4...@xs4all.nl Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a

pgsql: Some refactoring of logical/worker.c

2020-03-24 Thread Peter Eisentraut
Some refactoring of logical/worker.c This moves the main operations of apply_handle_{insert|update|delete}, that of inserting, updating, deleting a tuple into/from a given relation, into corresponding apply_handle_{insert|update|delete}_internal functions. This allows performing those operations

pgsql: Add support for other normal forms to Unicode normalization API

2020-03-24 Thread Peter Eisentraut
Add support for other normal forms to Unicode normalization API It previously only supported NFKC, for use by SASLprep. This expands the API to offer the choice of all four normalization forms. Right now, there are no internal users of the forms other than NFKC. Reviewed-by: Daniel Verite Revi