postgresql/src
Andres Freund 560bb56c6e Fix memory leak and inefficiency in CREATE DATABASE ... STRATEGY WAL_LOG
RelationCopyStorageUsingBuffer() did not free the strategies used to access
the source / target relation. They memory was released at the end of the
transaction, but when using a template database with a lot of relations, the
temporary leak can become big prohibitively big.

RelationCopyStorageUsingBuffer() acquired the buffer for the target relation
with RBM_NORMAL, therefore requiring a read of a block guaranteed to be
zero. Use RBM_ZERO_AND_LOCK instead.

Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://postgr.es/m/20230321070113.o2vqqxogjykwgfrr@awork3.anarazel.de
Backpatch: 15-, where STRATEGY WAL_LOG was introduced
2023-03-22 09:26:23 -07:00
..
backend Fix memory leak and inefficiency in CREATE DATABASE ... STRATEGY WAL_LOG 2023-03-22 09:26:23 -07:00
bin Fix pg_dump for hash partitioning on enum columns. 2023-03-17 13:31:40 -04:00
common Fix JSON error reporting for many cases of erroneous string values. 2023-03-13 15:19:00 -04:00
fe_utils Use correct connection for cancellation in frontend's parallel slots 2022-08-27 15:22:07 +09:00
include Fix race in parallel hash join batch cleanup, take II. 2023-03-21 14:32:14 +13:00
interfaces Fix inconsistent error handling for GSS encryption in PQconnectPoll() 2023-03-13 16:36:28 +09:00
makefiles Refactor DLSUFFIX handling 2022-03-25 08:56:02 +01:00
pl Add missing support for the latest SPI status codes. 2023-02-22 13:24:51 +00:00
port Improve WIN32 port of fstat() to detect more file types 2023-03-15 12:56:06 +09:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:28:55 -04:00
test Ignore dropped columns during apply of update/delete. 2023-03-21 09:40:41 +05:30
timezone Update time zone data files to tzdata release 2022g. 2023-01-31 17:37:06 -05:00
tools Don't force SQL_ASCII/no-locale for installcheck in vcregress.pl 2023-02-26 06:52:23 -05:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Prevent port collisions between concurrent TAP tests 2022-11-22 10:51:13 -05:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:27:59 -07:00
nls-global.mk Improve frontend error logging style. 2022-04-08 14:55:14 -04:00