Remove redundant AssertVariableIsOfType uses in pg_upgrade - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Remove redundant AssertVariableIsOfType uses in pg_upgrade
Date
Msg-id 3d289481-7f76-409f-81c7-81824219cc75@eisentraut.org
Whole thread Raw
Responses Re: Remove redundant AssertVariableIsOfType uses in pg_upgrade
Re: Remove redundant AssertVariableIsOfType uses in pg_upgrade
List pgsql-hackers
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.
Attachment

pgsql-hackers by date:

Previous
From: Tatsuro Yamada
Date:
Subject: Re: [PATCH] psql: add \dcs to list all constraints
Next
From: VASUKI M
Date:
Subject: Optional skipping of unchanged relations during ANALYZE?