@@ -71,7 +71,6 @@ PG_FUNCTION_INFO_V1( validate_interval_value );
71
71
72
72
PG_FUNCTION_INFO_V1 ( create_range_partitions_internal );
73
73
PG_FUNCTION_INFO_V1 ( generate_bounds );
74
- // PG_FUNCTION_INFO_V1( generate_bounds_by_range );
75
74
76
75
77
76
/*
@@ -1171,68 +1170,3 @@ generate_bounds(PG_FUNCTION_ARGS)
1171
1170
1172
1171
PG_RETURN_ARRAYTYPE_P (arr );
1173
1172
}
1174
-
1175
-
1176
- // Datum
1177
- // generate_bounds_by_range(PG_FUNCTION_ARGS)
1178
- // {
1179
- // /* input params */
1180
- // Datum start = PG_GETARG_DATUM(0);
1181
- // Datum end = PG_GETARG_DATUM(1);
1182
- // Oid v_type = get_fn_expr_argtype(fcinfo->flinfo, 0);
1183
- // Datum interval = PG_GETARG_DATUM(2);
1184
- // Oid i_type = get_fn_expr_argtype(fcinfo->flinfo, 2);
1185
- // int i;
1186
-
1187
- // /* operators */
1188
- // Oid plus_op_func;
1189
- // Datum plus_op_result;
1190
- // Oid plus_op_result_type;
1191
-
1192
- // FmgrInfo cmp_func;
1193
-
1194
- // /* array */
1195
- // ArrayType *arr;
1196
- // int16 elemlen;
1197
- // bool elembyval;
1198
- // char elemalign;
1199
- // Datum *datums;
1200
- // List *datum_list = NIL;
1201
-
1202
- // /* Find suitable addition operator for given value and interval */
1203
- // extract_op_func_and_ret_type("+", v_type, i_type,
1204
- // &plus_op_func,
1205
- // &plus_op_result_type);
1206
-
1207
- // /* Find comparison operator */
1208
- // fill_type_cmp_fmgr_info(&cmp_func,
1209
- // getBaseType(v_type),
1210
- // getBaseType(v_type));
1211
-
1212
- // while (DatumGetInt32(FunctionCall2(cmp_func, start, end)) < 0)
1213
- // {
1214
- // /* Invoke addition operator and get a result */
1215
- // plus_op_result = OidFunctionCall2(plus_op_func, start, interval);
1216
-
1217
- // if (plus_op_result_type != v_type)
1218
- // plus_op_result = perform_type_cast(plus_op_result,
1219
- // plus_op_result_type,
1220
- // v_type, NULL);
1221
- // start = plus_op_result;
1222
- // datum_list = lappend(datum_list, start);
1223
- // }
1224
-
1225
- // datums = palloc(sizeof(Datum) * list_length(datum_list));
1226
- // foreach(lc, datum_list)
1227
- // datums[i++] = (Datum) lfirst(lc);
1228
-
1229
- // /* build an array based on calculated datums */
1230
- // get_typlenbyvalalign(v_type, &elemlen, &elembyval, &elemalign);
1231
- // arr = construct_array(datums, count + 1, v_type,
1232
- // elemlen, elembyval, elemalign);
1233
-
1234
- // pfree(datums);
1235
- // list_free(datum_list);
1236
-
1237
- // PG_RETURN_ARRAYTYPE_P(arr);
1238
- // }
0 commit comments