run-time_prune_only_for_partitioned_tables.patch

application/octet-stream

Filename: run-time_prune_only_for_partitioned_tables.patch
Type: application/octet-stream
Part: 0
Message: Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/optimizer/plan/createplan.c 2 1
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index ca2e0527db..fad14da892 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -1079,7 +1079,8 @@ create_append_plan(PlannerInfo *root, AppendPath *best_path)
 
 	if (enable_partition_pruning &&
 		rel->reloptkind == RELOPT_BASEREL &&
-		best_path->partitioned_rels != NIL)
+		best_path->partitioned_rels != NIL &&
+		root->simple_rte_array[rel->relid]->relkind == RELKIND_PARTITIONED_TABLE)
 	{
 		List	   *prunequal;