aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2023-03-20 21:57:40 -0700
committerAndres Freund <andres@anarazel.de>2023-03-22 09:20:34 -0700
commit5df319f3d55d09fadb4f7e4b58c5b476a3aeceb4 (patch)
treeaef695f85ea8ae08975f565551129c6ef222959f /src/backend/executor/nodeModifyTable.c
parentbbc1376b39627c6bddd8a0dc0a7dda24c91a97a0 (diff)
downloadpostgresql-5df319f3d55d09fadb4f7e4b58c5b476a3aeceb4.tar.gz
postgresql-5df319f3d55d09fadb4f7e4b58c5b476a3aeceb4.zip
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
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions