pgsql: Fix memory leak introduced in commit 7df159a620.

2019-10-20 Thread Amit Kapila
Fix memory leak introduced in commit 7df159a620. We memorize all internal and empty leaf pages in the 1st vacuum stage for gist indexes. They are used in the 2nd stage, to delete all the empty pages. There was a memory context page_set_context for this purpose, but we never used it. Reported-by

pgsql: Fix memory leak introduced in commit 7df159a620.

2019-10-20 Thread Amit Kapila
Fix memory leak introduced in commit 7df159a620. We memorize all internal and empty leaf pages in the 1st vacuum stage for gist indexes. They are used in the 2nd stage, to delete all the empty pages. There was a memory context page_set_context for this purpose, but we never used it. Reported-by

Re: pgsql: Remove last traces of heap_open/close in the tree

2019-10-20 Thread Michael Paquier
On Sat, Oct 19, 2019 at 02:25:46AM +, Michael Paquier wrote: > Remove last traces of heap_open/close in the tree > > Since pluggable storage has been introduced, those two routines have > been replaced by table_open/close, with some compatibility macros still > present to allow extensions to c

pgsql: Fix error reporting of connect_timeout in libpq for value parsin

2019-10-20 Thread Michael Paquier
Fix error reporting of connect_timeout in libpq for value parsing The logic was correctly detecting a parsing failure, but the parsing error did not get reported back to the client properly. Reported-by: Ed Morley Author: Lars Kanis Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/a9

pgsql: Fix error reporting of connect_timeout in libpq for value parsin

2019-10-20 Thread Michael Paquier
Fix error reporting of connect_timeout in libpq for value parsing The logic was correctly detecting a parsing failure, but the parsing error did not get reported back to the client properly. Reported-by: Ed Morley Author: Lars Kanis Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/a9

pgsql: Fix parsing of integer values for connection parameters in libpq

2019-10-20 Thread Michael Paquier
Fix parsing of integer values for connection parameters in libpq Commit e7a2217 has introduced stricter checks for integer values in connection parameters for libpq. However this failed to correctly check after trailing whitespaces, while leading whitespaces were discarded per the use of strtol(3

pgsql: Fix parsing of integer values for connection parameters in libpq

2019-10-20 Thread Michael Paquier
Fix parsing of integer values for connection parameters in libpq Commit e7a2217 has introduced stricter checks for integer values in connection parameters for libpq. However this failed to correctly check after trailing whitespaces, while leading whitespaces were discarded per the use of strtol(3

pgsql: Clean up MinGW def file generation

2019-10-20 Thread Peter Eisentraut
Clean up MinGW def file generation There were some leftovers from ancient ad-hoc ways to build on Windows, prior to the standardization on MSVC and MinGW. We don't need to build a lib$(NAME)ddll.def (debug build, as opposed to lib$(NAME)dll.def) for MinGW, since nothing uses that. We also don't