Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Fabien COELHO
Bonjour Michaël, This change leads a compiler warning on my machine: pgbench.c: In function ‘readCommandResponse’: pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code C99 does not forbid that (see d9dd406). https://www.postgresql.org/docs/devel/source-conventions.html also

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Andres Freund
On April 9, 2019 11:07:38 PM PDT, Michael Paquier wrote: >On Wed, Apr 10, 2019 at 01:19:11PM +0900, Masahiko Sawada wrote: >> This change leads a compiler warning on my machine: >> >> pgbench.c: In function ‘readCommandResponse’: >> pgbench.c:2730: warning: ISO C90 forbids mixed declarations a

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Fabien COELHO
Hello Masahiko-san, This change leads a compiler warning on my machine: pgbench.c: In function ‘readCommandResponse’: pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code says: "Code in PostgreSQL should only re

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Michael Paquier
On Wed, Apr 10, 2019 at 01:19:11PM +0900, Masahiko Sawada wrote: > This change leads a compiler warning on my machine: > > pgbench.c: In function ‘readCommandResponse’: > pgbench.c:2730: warning: ISO C90 forbids mixed declarations and code C99 does not forbid that (see d9dd406). -- Michael sign

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Masahiko Sawada
On Wed, Apr 10, 2019 at 2:00 AM Alvaro Herrera wrote: > > Fix memory leak in pgbench > > Commit 25ee70511ec2 introduced a memory leak in pgbench: some PGresult > structs were not being freed during error bailout, because we're now > doing more PQgetResult() calls than previously. Since there's mo

pgsql: Avoid counting transaction stats for parallel worker cooperating

2019-04-09 Thread Amit Kapila
Avoid counting transaction stats for parallel worker cooperating transaction. The transaction that is initiated by the parallel worker to cooperate with the actual transaction started by the main backend to complete the query execution should not be counted as a separate transaction. The other in

pgsql: Avoid counting transaction stats for parallel worker cooperating

2019-04-09 Thread Amit Kapila
Avoid counting transaction stats for parallel worker cooperating transaction. The transaction that is initiated by the parallel worker to cooperate with the actual transaction started by the main backend to complete the query execution should not be counted as a separate transaction. The other in

pgsql: Avoid counting transaction stats for parallel worker cooperating

2019-04-09 Thread Amit Kapila
Avoid counting transaction stats for parallel worker cooperating transaction. The transaction that is initiated by the parallel worker to cooperate with the actual transaction started by the main backend to complete the query execution should not be counted as a separate transaction. The other in

pgsql: Avoid counting transaction stats for parallel worker cooperating

2019-04-09 Thread Amit Kapila
Avoid counting transaction stats for parallel worker cooperating transaction. The transaction that is initiated by the parallel worker to cooperate with the actual transaction started by the main backend to complete the query execution should not be counted as a separate transaction. The other in

pgsql: Improve comment in sync.h.

2019-04-09 Thread Thomas Munro
Improve comment in sync.h. Per off-list complaint from Andres Freund. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d614aae02e8f878438716b7fd2642b8240b3f2b3 Modified Files -- src/include/storage/sync.h | 4 ++-- 1 file changed, 2 insertions(+), 2 delet

pgsql: Fix typos.

2019-04-09 Thread Thomas Munro
Fix typos. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/255044889d419354b46a2bf8907b83507d695af5 Modified Files -- src/backend/executor/execTuples.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

pgsql: Prevent inlining of multiply-referenced CTEs with outer recursiv

2019-04-09 Thread Tom Lane
Prevent inlining of multiply-referenced CTEs with outer recursive refs. This has to be prevented because inlining would result in multiple self-references, which we don't support (and in fact that's disallowed by the SQL spec, see statements about linearly vs. nonlinearly recursive queries). Bug

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Alvaro Herrera
Hello On 2019-Apr-09, Fabien COELHO wrote: > > Fix memory leak in pgbench > > > Commit 25ee70511ec2 introduced a memory leak in pgbench: some PGresult > > structs were not being freed during error bailout, because we're now > > doing more PQgetResult() calls than previously. > > Indeed, I did n

Re: pgsql: Fix memory leak in pgbench

2019-04-09 Thread Fabien COELHO
Hello Alvaro, Fix memory leak in pgbench Commit 25ee70511ec2 introduced a memory leak in pgbench: some PGresult structs were not being freed during error bailout, because we're now doing more PQgetResult() calls than previously. Indeed, I did not consider cleaning up on errors when removi

pgsql: Fix typo

2019-04-09 Thread Alvaro Herrera
Fix typo Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4dba0f6dc407f965924d6c1007ac1bb5cc209dde Modified Files -- src/backend/replication/slotfuncs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix memory leak in pgbench

2019-04-09 Thread Alvaro Herrera
Fix memory leak in pgbench Commit 25ee70511ec2 introduced a memory leak in pgbench: some PGresult structs were not being freed during error bailout, because we're now doing more PQgetResult() calls than previously. Since there's more cleanup code outside the discard_response() routine than in it,

pgsql: Test some more cases with partitioned tables in EvalPlanQual.

2019-04-09 Thread Tom Lane
Test some more cases with partitioned tables in EvalPlanQual. We weren't testing anything involving EPQ on UPDATEs that move tuples into different partitions. Depending on the implementation, it might be that these cases aren't actually very interesting ... but given our thin coverage of EPQ in g

pgsql: Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds.

2019-04-09 Thread Noah Misch
Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. The MSVC build system already did this, and commit 617dc6d299c957e2784320382b3277ede01d9c63 used it in a second file. Back-patch to 9.4, like that commit. Discussion: https://postgr.es/m/CAA8=A7_1SWc3+3Z=-utqrqfotrj_deohrvt7dia2tzozxs

pgsql: Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds.

2019-04-09 Thread Noah Misch
Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. The MSVC build system already did this, and commit 617dc6d299c957e2784320382b3277ede01d9c63 used it in a second file. Back-patch to 9.4, like that commit. Discussion: https://postgr.es/m/CAA8=A7_1SWc3+3Z=-utqrqfotrj_deohrvt7dia2tzozxs

pgsql: Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds.

2019-04-09 Thread Noah Misch
Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. The MSVC build system already did this, and commit 617dc6d299c957e2784320382b3277ede01d9c63 used it in a second file. Back-patch to 9.4, like that commit. Discussion: https://postgr.es/m/CAA8=A7_1SWc3+3Z=-utqrqfotrj_deohrvt7dia2tzozxs

pgsql: Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds.

2019-04-09 Thread Noah Misch
Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. The MSVC build system already did this, and commit 617dc6d299c957e2784320382b3277ede01d9c63 used it in a second file. Back-patch to 9.4, like that commit. Discussion: https://postgr.es/m/CAA8=A7_1SWc3+3Z=-utqrqfotrj_deohrvt7dia2tzozxs

pgsql: Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds.

2019-04-09 Thread Noah Misch
Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. The MSVC build system already did this, and commit 617dc6d299c957e2784320382b3277ede01d9c63 used it in a second file. Back-patch to 9.4, like that commit. Discussion: https://postgr.es/m/CAA8=A7_1SWc3+3Z=-utqrqfotrj_deohrvt7dia2tzozxs

pgsql: Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds.

2019-04-09 Thread Noah Misch
Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. The MSVC build system already did this, and commit 617dc6d299c957e2784320382b3277ede01d9c63 used it in a second file. Back-patch to 9.4, like that commit. Discussion: https://postgr.es/m/CAA8=A7_1SWc3+3Z=-utqrqfotrj_deohrvt7dia2tzozxs

Re: pgsql: Avoid "could not reattach" by providing space for concurrent all

2019-04-09 Thread Andrew Dunstan
On Tue, Apr 9, 2019 at 12:44 AM Noah Misch wrote: > > Avoid "could not reattach" by providing space for concurrent allocation. > This has broken builds on frogmouth, and I'm betting any mingw animal. cheers andrew -- Andrew Dunstanhttps://www.2ndQuadrant.com PostgreSQL Develo

pgsql: Replace tabs with spaces in one .sql file

2019-04-09 Thread Peter Eisentraut
Replace tabs with spaces in one .sql file Let's at least keep this consistent within the same file. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9efe068e48f09d915660576f5672bfa9f1c0eb53 Modified Files -- src/backend/catalog/system_views.sql | 334 +++