Remove redundant AssertVariableIsOfType uses in pg_upgrade
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-01-20T10:07:47Z
Lists: pgsql-hackers
Attachments
- 0001-Remove-redundant-AssertVariableIsOfType-uses.patch (text/plain) patch 0001
pg_upgrade code contains a number of lines like
AssertVariableIsOfType(&process_rel_infos, UpgradeTaskProcessCB);
This is presumably to ensure that the function signature is fitting for
being used with upgrade_task_add_step(). But the signature of
upgrade_task_add_step() already checks that itself, so these additional
assertions are redundant, and I find them confusing. So I propose to
remove them.
In the original thread
<https://www.postgresql.org/message-id/flat/20240516211638.GA1688936%40nathanxps13>
I found that this pattern was introduced between patch versions v9 and
v10, but there was no further explanation.
Commits
-
Remove redundant AssertVariableIsOfType uses
- f3c96c9dff0c 19 (unreleased) landed
-
Remove uses of AssertVariableIsOfType() obsoleted by f2b73c8
- 30b789eafed2 16.0 cited