pgsql: Try to stabilize results of new tuplesort regression test.

2019-12-14 Thread Tom Lane
Try to stabilize results of new tuplesort regression test. It appears that a concurrent autovacuum/autoanalyze run can cause changes in the plans expected by this test. To prevent that, change the tables it uses to be temp tables --- there's no need for them to be permanent, and this should save

pgsql: Prevent overly-aggressive collapsing of joins to RTE_RESULT rela

2019-12-14 Thread Tom Lane
Prevent overly-aggressive collapsing of joins to RTE_RESULT relations. The RTE_RESULT simplification logic added by commit 4be058fe9 had a flaw: it would collapse out a RTE_RESULT that is due to compute a PlaceHolderVar, and reassign the PHV to the parent join level, even if another input relation

pgsql: Prevent overly-aggressive collapsing of joins to RTE_RESULT rela

2019-12-14 Thread Tom Lane
Prevent overly-aggressive collapsing of joins to RTE_RESULT relations. The RTE_RESULT simplification logic added by commit 4be058fe9 had a flaw: it would collapse out a RTE_RESULT that is due to compute a PlaceHolderVar, and reassign the PHV to the parent join level, even if another input relation

pgsql: Fix memory leak when initializing DH parameters in backend

2019-12-14 Thread Michael Paquier
Fix memory leak when initializing DH parameters in backend When loading DH parameters used for the generation of ephemeral DH keys in the backend, the code has never bothered releasing the memory used for the DH information loaded from a file or from libpq's default. This commit makes sure that t