@@ -374,20 +374,28 @@ make_partition_filter(Plan *subplan, Oid parent_relid,
374
374
CustomScan * cscan = makeNode (CustomScan );
375
375
Relation parent_rel ;
376
376
377
+ /* Currenly we don't support ON CONFLICT clauses */
378
+ if (conflict_action != ONCONFLICT_NONE )
379
+ ereport (ERROR ,
380
+ (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
381
+ errmsg ("ON CONFLICT clause is not supported with partitioned tables" )));
382
+
383
+ /* Copy costs etc */
377
384
cscan -> scan .plan .startup_cost = subplan -> startup_cost ;
378
385
cscan -> scan .plan .total_cost = subplan -> total_cost ;
379
386
cscan -> scan .plan .plan_rows = subplan -> plan_rows ;
380
387
cscan -> scan .plan .plan_width = subplan -> plan_width ;
381
388
389
+ /* Setup methods and child plan */
382
390
cscan -> methods = & partition_filter_plan_methods ;
383
391
cscan -> custom_plans = list_make1 (subplan );
384
392
393
+ /* Build an appropriate target list using a cached Relation entry */
385
394
parent_rel = RelationIdGetRelation (parent_relid );
386
- cscan -> scan .plan .targetlist = pfilter_build_tlist (parent_rel ,
387
- subplan -> targetlist );
395
+ cscan -> scan .plan .targetlist = pfilter_build_tlist (parent_rel ,subplan -> targetlist );
388
396
RelationClose (parent_rel );
389
397
390
- /* No relation will be scanned */
398
+ /* Nophysical relation will be scanned */
391
399
cscan -> scan .scanrelid = 0 ;
392
400
cscan -> custom_scan_tlist = subplan -> targetlist ;
393
401