postgresql/src
Tom Lane 131f6a9583 In libpq, free any partial query result before collecting a server error.
We'd throw away the partial result anyway after parsing the error message.
Throwing it away beforehand costs nothing and reduces the risk of
out-of-memory failure.  Also, at least in systems that behave like
glibc/Linux, if the partial result was very large then the error PGresult
would get allocated at high heap addresses, preventing the heap storage
used by the partial result from being released to the OS until the error
PGresult is freed.

In psql >= 9.6, we hold onto the error PGresult until another error is
received (for \errverbose), so that this behavior causes a seeming
memory leak to persist for awhile, as in a recent complaint from
Darafei Praliaskouski.  This is a potential performance regression from
older versions, justifying back-patching at least that far.  But similar
behavior may occur in other client applications, so it seems worth just
back-patching to all supported branches.

Discussion: https://postgr.es/m/CAC8Q8tJ=7cOkPePyAbJE_Pf691t8nDFhJp0KZxHvnq_uicfyVg@mail.gmail.com
2018-04-13 12:53:46 -04:00
..
backend Fix bogus affix-merging code. 2018-04-12 18:39:51 -04:00
bin Fix assorted issues in parallel vacuumdb. 2018-03-31 16:28:52 -04:00
common pgindent run for 9.6 2016-06-09 18:02:36 -04:00
fe_utils Empty search_path in Autovacuum and non-psql/pgbench clients. 2018-02-26 07:39:48 -08:00
include Remove overzeleous assertions in pg_atomic_flag code. 2018-04-07 18:30:15 -07:00
interfaces In libpq, free any partial query result before collecting a server error. 2018-04-13 12:53:46 -04:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:56 -04:00
pl Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
port Stamp 9.6.8. 2018-02-26 17:13:40 -05:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test Fix and improve pg_atomic_flag fallback implementation. 2018-04-06 20:02:02 -07:00
timezone Update time zone data files to tzdata release 2018c. 2018-01-27 16:42:44 -05:00
tools Fix up ecpg's configuration so it handles "long long int" in MSVC builds. 2018-02-27 16:46:52 -05:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore
bcc32.mak
DEVELOPERS
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in PL/Perl portability fix: absorb relevant -D switches from Perl. 2017-07-31 12:38:35 -04:00
Makefile.shlib Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak