1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Restore smgrtruncate() prototype in back-branches.

It's possible that external code is calling smgrtruncate().  Any
external callers might like to consider the recent changes to
RelationTruncate(), but commit 38c579b0 should not have changed the
function prototype in the back-branches, per ABI stability policy.

Restore smgrtruncate()'s traditional argument list in the back-branches,
but make it a wrapper for a new function smgrtruncate2().  The three
callers in core can use smgrtruncate2() directly.  In master (18-to-be),
smgrtruncate2() is effectively renamed to smgrtruncate(), so this wart
is cleaned up.

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CA%2BhUKG%2BThae6x6%2BjmQiuALQBT2Ae1ChjMh1%3DkMvJ8y_SBJZrvA%40mail.gmail.com
This commit is contained in:
Thomas Munro
2025-01-08 07:50:30 +13:00
parent 9577dd523b
commit f154f028d8
4 changed files with 28 additions and 6 deletions

View File

@ -429,7 +429,7 @@ pg_truncate_visibility_map(PG_FUNCTION_ARGS)
}
if (BlockNumberIsValid(block))
smgrtruncate(RelationGetSmgr(rel), &fork, 1, &old_block, &block);
smgrtruncate2(RelationGetSmgr(rel), &fork, 1, &old_block, &block);
END_CRIT_SECTION();
MyProc->delayChkpt = false;