1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-26 09:41:40 +03:00

Remove redundant AssertVariableIsOfType uses

The uses of AssertVariableIsOfType in pg_upgrade are unnecessary
because the calls to upgrade_task_add_step() already check the
compatibility of the callback functions.

These were apparently copied from a previous coding style, but similar
removals were already done in commit 30b789eafe.

Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/3d289481-7f76-409f-81c7-81824219cc75%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2026-01-22 09:19:13 +01:00
parent ae4fe737ae
commit f3c96c9dff
4 changed files with 0 additions and 32 deletions

View File

@@ -400,8 +400,6 @@ process_data_type_check(DbInfo *dbinfo, PGresult *res, void *arg)
int i_attname = PQfnumber(res, "attname");
FILE *script = NULL;
AssertVariableIsOfType(&process_data_type_check, UpgradeTaskProcessCB);
if (ntups == 0)
return;
@@ -1279,9 +1277,6 @@ process_isn_and_int8_passing_mismatch(DbInfo *dbinfo, PGresult *res, void *arg)
int i_proname = PQfnumber(res, "proname");
UpgradeTaskReport *report = (UpgradeTaskReport *) arg;
AssertVariableIsOfType(&process_isn_and_int8_passing_mismatch,
UpgradeTaskProcessCB);
if (ntups == 0)
return;
@@ -1368,9 +1363,6 @@ process_user_defined_postfix_ops(DbInfo *dbinfo, PGresult *res, void *arg)
int i_typnsp = PQfnumber(res, "typnsp");
int i_typname = PQfnumber(res, "typname");
AssertVariableIsOfType(&process_user_defined_postfix_ops,
UpgradeTaskProcessCB);
if (ntups == 0)
return;
@@ -1459,9 +1451,6 @@ process_incompat_polymorphics(DbInfo *dbinfo, PGresult *res, void *arg)
int i_objkind = PQfnumber(res, "objkind");
int i_objname = PQfnumber(res, "objname");
AssertVariableIsOfType(&process_incompat_polymorphics,
UpgradeTaskProcessCB);
if (ntups == 0)
return;
@@ -1592,8 +1581,6 @@ process_with_oids_check(DbInfo *dbinfo, PGresult *res, void *arg)
int i_nspname = PQfnumber(res, "nspname");
int i_relname = PQfnumber(res, "relname");
AssertVariableIsOfType(&process_with_oids_check, UpgradeTaskProcessCB);
if (ntups == 0)
return;
@@ -1663,9 +1650,6 @@ process_inconsistent_notnull(DbInfo *dbinfo, PGresult *res, void *arg)
int i_relname = PQfnumber(res, "relname");
int i_attname = PQfnumber(res, "attname");
AssertVariableIsOfType(&process_inconsistent_notnull,
UpgradeTaskProcessCB);
if (ntups == 0)
return;
@@ -1751,8 +1735,6 @@ process_gist_inet_ops_check(DbInfo *dbinfo, PGresult *res, void *arg)
int i_nspname = PQfnumber(res, "nspname");
int i_relname = PQfnumber(res, "relname");
AssertVariableIsOfType(&process_gist_inet_ops_check, UpgradeTaskProcessCB);
if (ntups == 0)
return;
@@ -1886,9 +1868,6 @@ process_user_defined_encoding_conversions(DbInfo *dbinfo, PGresult *res, void *a
int i_conname = PQfnumber(res, "conname");
int i_nspname = PQfnumber(res, "nspname");
AssertVariableIsOfType(&process_user_defined_encoding_conversions,
UpgradeTaskProcessCB);
if (ntups == 0)
return;
@@ -2398,8 +2377,6 @@ process_old_sub_state_check(DbInfo *dbinfo, PGresult *res, void *arg)
int i_nspname = PQfnumber(res, "nspname");
int i_relname = PQfnumber(res, "relname");
AssertVariableIsOfType(&process_old_sub_state_check, UpgradeTaskProcessCB);
if (ntups == 0)
return;

View File

@@ -61,8 +61,6 @@ process_loadable_libraries(DbInfo *dbinfo, PGresult *res, void *arg)
{
struct loadable_libraries_state *state = (struct loadable_libraries_state *) arg;
AssertVariableIsOfType(&process_loadable_libraries, UpgradeTaskProcessCB);
state->ress[dbinfo - old_cluster.dbarr.dbs] = res;
state->totaltups += PQntuples(res);
}

View File

@@ -601,8 +601,6 @@ process_rel_infos(DbInfo *dbinfo, PGresult *res, void *arg)
char *last_namespace = NULL;
char *last_tablespace = NULL;
AssertVariableIsOfType(&process_rel_infos, UpgradeTaskProcessCB);
for (int relnum = 0; relnum < ntups; relnum++)
{
RelInfo *curr = &relinfos[num_rels++];
@@ -727,9 +725,6 @@ process_old_cluster_logical_slot_infos(DbInfo *dbinfo, PGresult *res, void *arg)
LogicalSlotInfo *slotinfos = NULL;
int num_slots = PQntuples(res);
AssertVariableIsOfType(&process_old_cluster_logical_slot_infos,
UpgradeTaskProcessCB);
if (num_slots)
{
int i_slotname;

View File

@@ -152,8 +152,6 @@ process_extension_updates(DbInfo *dbinfo, PGresult *res, void *arg)
UpgradeTaskReport *report = (UpgradeTaskReport *) arg;
PQExpBufferData connectbuf;
AssertVariableIsOfType(&process_extension_updates, UpgradeTaskProcessCB);
if (ntups == 0)
return;