pgsql: Adjust comment atop ExecShutdownNode.

2018-08-12 Thread Amit Kapila
Adjust comment atop ExecShutdownNode. After commits a315b967cc and b805b63ac2, part of the comment atop ExecShutdownNode is redundant. Adjust it. Author: Amit Kapila Backpatch-through: 10 where both the mentioned commits are present. Discussion: https://postgr.es/m/86137f17-1dfb-42f9-7421-82fd7

pgsql: Adjust comment atop ExecShutdownNode.

2018-08-12 Thread Amit Kapila
Adjust comment atop ExecShutdownNode. After commits a315b967cc and b805b63ac2, part of the comment atop ExecShutdownNode is redundant. Adjust it. Author: Amit Kapila Backpatch-through: 10 where both the mentioned commits are present. Discussion: https://postgr.es/m/86137f17-1dfb-42f9-7421-82fd7

pgsql: Adjust comment atop ExecShutdownNode.

2018-08-12 Thread Amit Kapila
Adjust comment atop ExecShutdownNode. After commits a315b967cc and b805b63ac2, part of the comment atop ExecShutdownNode is redundant. Adjust it. Author: Amit Kapila Backpatch-through: 10 where both the mentioned commits are present. Discussion: https://postgr.es/m/86137f17-1dfb-42f9-7421-82fd7

pgsql: Prohibit shutting down resources if there is a possibility of ba

2018-08-12 Thread Amit Kapila
Prohibit shutting down resources if there is a possibility of back up. Currently, we release the asynchronous resources as soon as it is evident that no more rows will be needed e.g. when a Limit is filled. This can be problematic especially for custom and foreign scans where we can scan backward

pgsql: Prohibit shutting down resources if there is a possibility of ba

2018-08-12 Thread Amit Kapila
Prohibit shutting down resources if there is a possibility of back up. Currently, we release the asynchronous resources as soon as it is evident that no more rows will be needed e.g. when a Limit is filled. This can be problematic especially for custom and foreign scans where we can scan backward

pgsql: Prohibit shutting down resources if there is a possibility of ba

2018-08-12 Thread Amit Kapila
Prohibit shutting down resources if there is a possibility of back up. Currently, we release the asynchronous resources as soon as it is evident that no more rows will be needed e.g. when a Limit is filled. This can be problematic especially for custom and foreign scans where we can scan backward

pgsql: Prohibit shutting down resources if there is a possibility of ba

2018-08-12 Thread Amit Kapila
Prohibit shutting down resources if there is a possibility of back up. Currently, we release the asynchronous resources as soon as it is evident that no more rows will be needed e.g. when a Limit is filled. This can be problematic especially for custom and foreign scans where we can scan backward

pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321)

2018-08-12 Thread Andrew Gierth
Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) Multiple calls to XMLTABLE in a query (e.g. laterally applying it to a table with an xml column, an important use-case) were leaking large amounts of memory into the per-query context, blowing up memory usage. Repair by reorganizing memor

pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321)

2018-08-12 Thread Andrew Gierth
Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) Multiple calls to XMLTABLE in a query (e.g. laterally applying it to a table with an xml column, an important use-case) were leaking large amounts of memory into the per-query context, blowing up memory usage. Repair by reorganizing memor

pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321)

2018-08-12 Thread Andrew Gierth
Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) Multiple calls to XMLTABLE in a query (e.g. laterally applying it to a table with an xml column, an important use-case) were leaking large amounts of memory into the per-query context, blowing up memory usage. Repair by reorganizing memor

Re: pgsql: Fix bogus loop logic in 013_crash_restart test's pump_until subr

2018-08-12 Thread Thomas Munro
On Mon, Aug 13, 2018 at 10:05 AM, Tom Lane wrote: > Fix bogus loop logic in 013_crash_restart test's pump_until subroutine. > > The pump_nb() step might've already received the desired data, so we must > check for that at the top of the loop not the bottom. Otherwise, the > call to pump() will si

pgsql: Revert "Distinguish printf-like functions that support %m from t

2018-08-12 Thread Tom Lane
Revert "Distinguish printf-like functions that support %m from those that don't." This reverts commit 3a60c8ff892a8242b907f44702bfd9f1ff877d45. Buildfarm results show that that caused a whole bunch of new warnings on platforms where gcc believes the local printf to be non-POSIX-compliant. This

pgsql: Fix bogus loop logic in 013_crash_restart test's pump_until subr

2018-08-12 Thread Tom Lane
Fix bogus loop logic in 013_crash_restart test's pump_until subroutine. The pump_nb() step might've already received the desired data, so we must check for that at the top of the loop not the bottom. Otherwise, the call to pump() will sit with nothing to do until the timeout elapses. pump_until t

pgsql: Fix bogus loop logic in 013_crash_restart test's pump_until subr

2018-08-12 Thread Tom Lane
Fix bogus loop logic in 013_crash_restart test's pump_until subroutine. The pump_nb() step might've already received the desired data, so we must check for that at the top of the loop not the bottom. Otherwise, the call to pump() will sit with nothing to do until the timeout elapses. pump_until t