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

pgsql: Fix run-time partition pruning for appends with multiple source

2018-08-01 Thread Tom Lane
Fix run-time partition pruning for appends with multiple source rels. The previous coding here supposed that if run-time partitioning applied to a particular Append/MergeAppend plan, then all child plans of that node must be members of a single partitioning hierarchy. This is totally wrong, since

pgsql: Fix run-time partition pruning for appends with multiple source

2018-08-01 Thread Tom Lane
Fix run-time partition pruning for appends with multiple source rels. The previous coding here supposed that if run-time partitioning applied to a particular Append/MergeAppend plan, then all child plans of that node must be members of a single partitioning hierarchy. This is totally wrong, since

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: expected '=', ',', ';', 'asm'

pgsql: Fix logical replication slot initialization

2018-08-01 Thread Alvaro Herrera
Fix logical replication slot initialization This was broken in commit 9c7d06d60680, which inadvertently gave the wrong value to fast_forward in one StartupDecodingContext call. Fix by flipping the value. Add a test for the obvious error, namely trying to initialize a replication slot with an non

pgsql: Fix logical replication slot initialization

2018-08-01 Thread Alvaro Herrera
Fix logical replication slot initialization This was broken in commit 9c7d06d60680, which inadvertently gave the wrong value to fast_forward in one StartupDecodingContext call. Fix by flipping the value. Add a test for the obvious error, namely trying to initialize a replication slot with an non

pgsql: Fix unnoticed variable shadowing in previous commit

2018-08-01 Thread Alvaro Herrera
Fix unnoticed variable shadowing in previous commit Per buildfarm. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/91bc213d90c5a8f2b2e162d4ecf09b9301027ceb Modified Files -- src/backend/executor/execPartition.c | 1 - 1 file changed, 1 deletion(-)

pgsql: Fix per-tuple memory leak in partition tuple routing

2018-08-01 Thread Alvaro Herrera
Fix per-tuple memory leak in partition tuple routing Some operations were being done in a longer-lived memory context, causing intra-query leaks. It's not noticeable unless you're doing a large COPY, but if you are, it eats enough memory to cause a problem. Co-authored-by: Kohei KaiGai Co-autho

pgsql: Fix per-tuple memory leak in partition tuple routing

2018-08-01 Thread Alvaro Herrera
Fix per-tuple memory leak in partition tuple routing Some operations were being done in a longer-lived memory context, causing intra-query leaks. It's not noticeable unless you're doing a large COPY, but if you are, it eats enough memory to cause a problem. Co-authored-by: Kohei KaiGai Co-autho

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

2018-08-01 Thread Tom Lane
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: expected '=', ',', ';', 'asm' or '__attribute__' before 'postmaster_possibly_dead' ./src

pgsql: Fix libpq's code for searching .pgpass; rationalize empty-list-i

2018-08-01 Thread Tom Lane
Fix libpq's code for searching .pgpass; rationalize empty-list-item cases. Before v10, we always searched ~/.pgpass using the host parameter, and nothing else, to match to the "hostname" field of ~/.pgpass. (However, null host or host matching DEFAULT_PGSOCKET_DIR was replaced by "localhost".) In

pgsql: Fix libpq's code for searching .pgpass; rationalize empty-list-i

2018-08-01 Thread Tom Lane
Fix libpq's code for searching .pgpass; rationalize empty-list-item cases. Before v10, we always searched ~/.pgpass using the host parameter, and nothing else, to match to the "hostname" field of ~/.pgpass. (However, null host or host matching DEFAULT_PGSOCKET_DIR was replaced by "localhost".) In

pgsql: Fix libpq's code for searching .pgpass; rationalize empty-list-i

2018-08-01 Thread Tom Lane
Fix libpq's code for searching .pgpass; rationalize empty-list-item cases. Before v10, we always searched ~/.pgpass using the host parameter, and nothing else, to match to the "hostname" field of ~/.pgpass. (However, null host or host matching DEFAULT_PGSOCKET_DIR was replaced by "localhost".) In

pgsql: Update parallel.sgml for Parallel Append

2018-08-01 Thread Robert Haas
Update parallel.sgml for Parallel Append Patch by me, reviewed by Thomas Munro, in response to a complaint from Adrien Nayrat. Discussion: http://postgr.es/m/[email protected] Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/ac

pgsql: Update parallel.sgml for Parallel Append

2018-08-01 Thread Robert Haas
Update parallel.sgml for Parallel Append Patch by me, reviewed by Thomas Munro, in response to a complaint from Adrien Nayrat. Discussion: http://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e80f2b335

pgsql: Allow multi-inserts during COPY into a partitioned table

2018-08-01 Thread Peter Eisentraut
Allow multi-inserts during COPY into a partitioned table CopyFrom allows multi-inserts to be used for non-partitioned tables, but this was disabled for partitioned tables. The reason for this appeared to be that the tuple may not belong to the same partition as the previous tuple did. Not allowi