@@ -509,10 +509,7 @@ fill_prel_with_partitions(PartRelationInfo *prel,
509
509
default :
510
510
{
511
511
DisablePathman (); /* disable pg_pathman since config is broken */
512
- ereport (ERROR ,
513
- (errmsg ("Unknown partitioning type for relation \"%s\"" ,
514
- get_rel_name_or_relid (PrelParentRelid (prel ))),
515
- errhint (INIT_ERROR_HINT )));
512
+ WrongPartType (prel -> parttype );
516
513
}
517
514
break ;
518
515
}
@@ -1243,10 +1240,7 @@ fill_pbin_with_bounds(PartBoundInfo *pbin,
1243
1240
default :
1244
1241
{
1245
1242
DisablePathman (); /* disable pg_pathman since config is broken */
1246
- ereport (ERROR ,
1247
- (errmsg ("Unknown partitioning type for relation \"%s\"" ,
1248
- get_rel_name_or_relid (PrelParentRelid (prel ))),
1249
- errhint (INIT_ERROR_HINT )));
1243
+ WrongPartType (prel -> parttype );
1250
1244
}
1251
1245
break ;
1252
1246
}
@@ -1264,41 +1258,6 @@ cmp_range_entries(const void *p1, const void *p2, void *arg)
1264
1258
}
1265
1259
1266
1260
1267
- /*
1268
- * Safe PartType wrapper.
1269
- */
1270
- PartType
1271
- DatumGetPartType (Datum datum )
1272
- {
1273
- uint32 val = DatumGetUInt32 (datum );
1274
-
1275
- if (val < 1 || val > 2 )
1276
- elog (ERROR , "Unknown partitioning type %u" , val );
1277
-
1278
- return (PartType ) val ;
1279
- }
1280
-
1281
- char *
1282
- PartTypeToCString (PartType parttype )
1283
- {
1284
- static char * hash_str = "1" ,
1285
- * range_str = "2" ;
1286
-
1287
- switch (parttype )
1288
- {
1289
- case PT_HASH :
1290
- return hash_str ;
1291
-
1292
- case PT_RANGE :
1293
- return range_str ;
1294
-
1295
- default :
1296
- elog (ERROR , "Unknown partitioning type %u" , parttype );
1297
- return NULL ; /* keep compiler happy */
1298
- }
1299
- }
1300
-
1301
-
1302
1261
/*
1303
1262
* Common PartRelationInfo checks. Emit ERROR if anything is wrong.
1304
1263
*/
0 commit comments