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

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

  1. Remove redundant AssertVariableIsOfType uses

  2. Remove uses of AssertVariableIsOfType() obsoleted by f2b73c8