@@ -960,7 +960,7 @@ ObjectAddress
960
960
get_object_address (ObjectType objtype , Node * object ,
961
961
Relation * relp , LOCKMODE lockmode , bool missing_ok )
962
962
{
963
- ObjectAddress address ;
963
+ ObjectAddress address = { InvalidOid , InvalidOid , 0 } ;
964
964
ObjectAddress old_address = {InvalidOid , InvalidOid , 0 };
965
965
Relation relation = NULL ;
966
966
uint64 inval_count ;
@@ -991,6 +991,7 @@ get_object_address(ObjectType objtype, Node *object,
991
991
& relation , lockmode ,
992
992
missing_ok );
993
993
break ;
994
+ case OBJECT_ATTRIBUTE :
994
995
case OBJECT_COLUMN :
995
996
address =
996
997
get_object_address_attribute (objtype , castNode (List , object ),
@@ -1163,14 +1164,12 @@ get_object_address(ObjectType objtype, Node *object,
1163
1164
missing_ok );
1164
1165
address .objectSubId = 0 ;
1165
1166
break ;
1166
- default :
1167
- elog (ERROR , "unrecognized object type: %d" , (int ) objtype );
1168
- /* placate compiler, in case it thinks elog might return */
1169
- address .classId = InvalidOid ;
1170
- address .objectId = InvalidOid ;
1171
- address .objectSubId = 0 ;
1167
+ /* no default, to let compiler warn about missing case */
1172
1168
}
1173
1169
1170
+ if (!address .classId )
1171
+ elog (ERROR , "unrecognized object type: %d" , (int ) objtype );
1172
+
1174
1173
/*
1175
1174
* If we could not find the supplied object, return without locking.
1176
1175
*/
@@ -2571,9 +2570,16 @@ check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
2571
2570
(errcode (ERRCODE_INSUFFICIENT_PRIVILEGE ),
2572
2571
errmsg ("must be superuser" )));
2573
2572
break ;
2574
- default :
2575
- elog (ERROR , "unrecognized object type: %d" ,
2576
- (int ) objtype );
2573
+ case OBJECT_AMOP :
2574
+ case OBJECT_AMPROC :
2575
+ case OBJECT_DEFAULT :
2576
+ case OBJECT_DEFACL :
2577
+ case OBJECT_PUBLICATION_NAMESPACE :
2578
+ case OBJECT_PUBLICATION_REL :
2579
+ case OBJECT_USER_MAPPING :
2580
+ /* These are currently not supported or don't make sense here. */
2581
+ elog (ERROR , "unsupported object type: %d" , (int ) objtype );
2582
+ break ;
2577
2583
}
2578
2584
}
2579
2585
0 commit comments