You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"payload":{"commit":{"oid":"4a2994f055be9405a254b22de6cd2107a0f46563","url":"/postgres/postgres/commit/4a2994f055be9405a254b22de6cd2107a0f46563","authoredDate":"2018-08-11T15:53:20.000-04:00","committedDate":"2018-08-11T15:53:20.000-04:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eFix wrong order of operations in inheritance_planner.\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"When considering a partitioning parent rel, we should stop processing that\nsubroot as soon as we've done adjust_appendrel_attrs and any securityQuals\nupdates. The rest of this is unnecessary, and indeed adding duplicate\nsubquery RTEs to the subroot is *wrong*. As the code stood, the children\nof that partition ended up with two sets of copied subquery RTEs, confusing\nmatters greatly. Even more hilarity ensued if all of the children got\nexcluded by constraint exclusion, so that the extra RTEs didn't make it\nback into the parent rtable.\n\nPer fuzz testing by Andreas Seltenreich. Back-patch to v11 where this\ngot broken (by commit \u003ca class=\"commit-link\" data-hovercard-type=\"commit\" data-hovercard-url=\"https://github.com/postgres/postgres/commit/0a480502b092195a9b25a2f0f199a21d592a9c57/hovercard\" href=\"https://github.com/postgres/postgres/commit/0a480502b092195a9b25a2f0f199a21d592a9c57\"\u003e\u003ctt\u003e0a48050\u003c/tt\u003e\u003c/a\u003e, it looks like).\n\nDiscussion: \u003ca href=\"https://postgr.es/m/87va8g7vq0.fsf@ansel.ydns.eu\" rel=\"nofollow\"\u003ehttps://postgr.es/m/87va8g7vq0.fsf@ansel.ydns.eu\u003c/a\u003e","authors":[{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false}],"committerAttribution":false,"committer":{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false},"parents":["a2a8acd15217b1e355c083a41da4dc5c7f35b30b"],"globalRelayId":"MDY6Q29tbWl0OTI3NDQyOjRhMjk5NGYwNTViZTk0MDVhMjU0YjIyZGU2Y2QyMTA3YTBmNDY1NjM=","sha1":"a2a8acd15217b1e355c083a41da4dc5c7f35b30b","sha2":"4a2994f055be9405a254b22de6cd2107a0f46563"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":1321,"text":"@@ -1322,6 +1322,59 @@ inheritance_planner(PlannerInfo *root)","html":"@@ -1322,6 +1322,59 @@ inheritance_planner(PlannerInfo *root)","displayNoNewLineWarning":false,"position":0,"left":1321,"right":1321},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1322,"text":" \t\tchild_rte-\u003esecurityQuals = parent_rte-\u003esecurityQuals;","html":" \t\t\u003cspan class=pl-s1\u003echild_rte\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003esecurityQuals\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003eparent_rte\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003esecurityQuals\u003c/span\u003e;","displayNoNewLineWarning":false,"position":1,"left":1322,"right":1322},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1323,"text":" \t\tparent_rte-\u003esecurityQuals = NIL;","html":" \t\t\u003cspan class=pl-s1\u003eparent_rte\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003esecurityQuals\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-c1\u003eNIL\u003c/span\u003e;","displayNoNewLineWarning":false,"position":2,"left":1323,"right":1323},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1324,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":3,"left":1324,"right":1324},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1325,"text":"+\t\t/*","html":"+\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":1324,"right":1325},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1326,"text":"+\t\t * Mark whether we're planning a query to a partitioned table or an","html":"+\u003cspan class=pl-c\u003e\t\t * Mark whether we\u0026#39;re planning a query to a partitioned table or an\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":1324,"right":1326},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1327,"text":"+\t\t * inheritance parent.","html":"+\u003cspan class=pl-c\u003e\t\t * inheritance parent.\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":1324,"right":1327},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1328,"text":"+\t\t */","html":"+\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":1324,"right":1328},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1329,"text":"+\t\tsubroot-\u003einhTargetKind =","html":"+\t\t\u003cspan class=pl-s1\u003esubroot\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003einhTargetKind\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":1324,"right":1329},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1330,"text":"+\t\t\tpartitioned_relids ? INHKIND_PARTITIONED : INHKIND_INHERITED;","html":"+\t\t\t\u003cspan class=pl-s1\u003epartitioned_relids\u003c/span\u003e ? \u003cspan class=pl-c1\u003eINHKIND_PARTITIONED\u003c/span\u003e : \u003cspan class=pl-c1\u003eINHKIND_INHERITED\u003c/span\u003e;","displayNoNewLineWarning":false,"position":9,"left":1324,"right":1330},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1331,"text":"+","html":"+","displayNoNewLineWarning":false,"position":10,"left":1324,"right":1331},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1332,"text":"+\t\t/*","html":"+\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":11,"left":1324,"right":1332},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1333,"text":"+\t\t * If this child is further partitioned, remember it as a parent.","html":"+\u003cspan class=pl-c\u003e\t\t * If this child is further partitioned, remember it as a parent.\u003c/span\u003e","displayNoNewLineWarning":false,"position":12,"left":1324,"right":1333},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1334,"text":"+\t\t * Since a partitioned table does not have any data, we don't need to","html":"+\u003cspan class=pl-c\u003e\t\t * Since a partitioned table does not have any data, we don\u0026#39;t need to\u003c/span\u003e","displayNoNewLineWarning":false,"position":13,"left":1324,"right":1334},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1335,"text":"+\t\t * create a plan for it, and we can stop processing it here. We do,","html":"+\u003cspan class=pl-c\u003e\t\t * create a plan for it, and we can stop processing it here. We do,\u003c/span\u003e","displayNoNewLineWarning":false,"position":14,"left":1324,"right":1335},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1336,"text":"+\t\t * however, need to remember its modified PlannerInfo for use when","html":"+\u003cspan class=pl-c\u003e\t\t * however, need to remember its modified PlannerInfo for use when\u003c/span\u003e","displayNoNewLineWarning":false,"position":15,"left":1324,"right":1336},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1337,"text":"+\t\t * processing its children, since we'll update their varnos based on","html":"+\u003cspan class=pl-c\u003e\t\t * processing its children, since we\u0026#39;ll update their varnos based on\u003c/span\u003e","displayNoNewLineWarning":false,"position":16,"left":1324,"right":1337},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1338,"text":"+\t\t * the delta from immediate parent to child, not from top to child.","html":"+\u003cspan class=pl-c\u003e\t\t * the delta from immediate parent to child, not from top to child.\u003c/span\u003e","displayNoNewLineWarning":false,"position":17,"left":1324,"right":1338},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1339,"text":"+\t\t *","html":"+\u003cspan class=pl-c\u003e\t\t *\u003c/span\u003e","displayNoNewLineWarning":false,"position":18,"left":1324,"right":1339},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1340,"text":"+\t\t * Note: a very non-obvious point is that we have not yet added","html":"+\u003cspan class=pl-c\u003e\t\t * Note: a very non-obvious point is that we have not yet added\u003c/span\u003e","displayNoNewLineWarning":false,"position":19,"left":1324,"right":1340},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1341,"text":"+\t\t * duplicate subquery RTEs to the subroot's rtable. We mustn't,","html":"+\u003cspan class=pl-c\u003e\t\t * duplicate subquery RTEs to the subroot\u0026#39;s rtable. We mustn\u0026#39;t,\u003c/span\u003e","displayNoNewLineWarning":false,"position":20,"left":1324,"right":1341},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1342,"text":"+\t\t * because then its children would have two sets of duplicates,","html":"+\u003cspan class=pl-c\u003e\t\t * because then its children would have two sets of duplicates,\u003c/span\u003e","displayNoNewLineWarning":false,"position":21,"left":1324,"right":1342},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1343,"text":"+\t\t * confusing matters.","html":"+\u003cspan class=pl-c\u003e\t\t * confusing matters.\u003c/span\u003e","displayNoNewLineWarning":false,"position":22,"left":1324,"right":1343},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1344,"text":"+\t\t */","html":"+\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":23,"left":1324,"right":1344},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1345,"text":"+\t\tif (child_rte-\u003einh)","html":"+\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003echild_rte\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003einh\u003c/span\u003e)","displayNoNewLineWarning":false,"position":24,"left":1324,"right":1345},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1346,"text":"+\t\t{","html":"+\t\t{","displayNoNewLineWarning":false,"position":25,"left":1324,"right":1346},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1347,"text":"+\t\t\tAssert(child_rte-\u003erelkind == RELKIND_PARTITIONED_TABLE);","html":"+\t\t\t\u003cspan class=pl-en\u003eAssert\u003c/span\u003e(\u003cspan class=pl-s1\u003echild_rte\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erelkind\u003c/span\u003e \u003cspan class=pl-c1\u003e==\u003c/span\u003e \u003cspan class=pl-c1\u003eRELKIND_PARTITIONED_TABLE\u003c/span\u003e);","displayNoNewLineWarning":false,"position":26,"left":1324,"right":1347},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1348,"text":"+\t\t\tparent_relids = bms_add_member(parent_relids, appinfo-\u003echild_relid);","html":"+\t\t\t\u003cspan class=pl-s1\u003eparent_relids\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003ebms_add_member\u003c/span\u003e(\u003cspan class=pl-s1\u003eparent_relids\u003c/span\u003e, \u003cspan class=pl-s1\u003eappinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003echild_relid\u003c/span\u003e);","displayNoNewLineWarning":false,"position":27,"left":1324,"right":1348},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1349,"text":"+\t\t\tparent_roots[appinfo-\u003echild_relid] = subroot;","html":"+\t\t\t\u003cspan class=pl-s1\u003eparent_roots\u003c/span\u003e[\u003cspan class=pl-s1\u003eappinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003echild_relid\u003c/span\u003e] \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003esubroot\u003c/span\u003e;","displayNoNewLineWarning":false,"position":28,"left":1324,"right":1349},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1350,"text":"+","html":"+","displayNoNewLineWarning":false,"position":29,"left":1324,"right":1350},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1351,"text":"+\t\t\tcontinue;","html":"+\t\t\t\u003cspan class=pl-k\u003econtinue\u003c/span\u003e;","displayNoNewLineWarning":false,"position":30,"left":1324,"right":1351},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1352,"text":"+\t\t}","html":"+\t\t}","displayNoNewLineWarning":false,"position":31,"left":1324,"right":1352},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1353,"text":"+","html":"+","displayNoNewLineWarning":false,"position":32,"left":1324,"right":1353},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1354,"text":"+\t\t/*","html":"+\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":33,"left":1324,"right":1354},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1355,"text":"+\t\t * Set the nominal target relation of the ModifyTable node if not","html":"+\u003cspan class=pl-c\u003e\t\t * Set the nominal target relation of the ModifyTable node if not\u003c/span\u003e","displayNoNewLineWarning":false,"position":34,"left":1324,"right":1355},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1356,"text":"+\t\t * already done. We use the inheritance parent RTE as the nominal","html":"+\u003cspan class=pl-c\u003e\t\t * already done. We use the inheritance parent RTE as the nominal\u003c/span\u003e","displayNoNewLineWarning":false,"position":35,"left":1324,"right":1356},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1357,"text":"+\t\t * target relation if it's a partitioned table (see just above this","html":"+\u003cspan class=pl-c\u003e\t\t * target relation if it\u0026#39;s a partitioned table (see just above this\u003c/span\u003e","displayNoNewLineWarning":false,"position":36,"left":1324,"right":1357},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1358,"text":"+\t\t * loop). In the non-partitioned parent case, we'll use the first","html":"+\u003cspan class=pl-c\u003e\t\t * loop). In the non-partitioned parent case, we\u0026#39;ll use the first\u003c/span\u003e","displayNoNewLineWarning":false,"position":37,"left":1324,"right":1358},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1359,"text":"+\t\t * child relation (even if it's excluded) as the nominal target","html":"+\u003cspan class=pl-c\u003e\t\t * child relation (even if it\u0026#39;s excluded) as the nominal target\u003c/span\u003e","displayNoNewLineWarning":false,"position":38,"left":1324,"right":1359},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1360,"text":"+\t\t * relation. Because of the way expand_inherited_rtentry works, the","html":"+\u003cspan class=pl-c\u003e\t\t * relation. Because of the way expand_inherited_rtentry works, the\u003c/span\u003e","displayNoNewLineWarning":false,"position":39,"left":1324,"right":1360},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1361,"text":"+\t\t * latter should be the RTE representing the parent table in its role","html":"+\u003cspan class=pl-c\u003e\t\t * latter should be the RTE representing the parent table in its role\u003c/span\u003e","displayNoNewLineWarning":false,"position":40,"left":1324,"right":1361},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1362,"text":"+\t\t * as a simple member of the inheritance set.","html":"+\u003cspan class=pl-c\u003e\t\t * as a simple member of the inheritance set.\u003c/span\u003e","displayNoNewLineWarning":false,"position":41,"left":1324,"right":1362},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1363,"text":"+\t\t *","html":"+\u003cspan class=pl-c\u003e\t\t *\u003c/span\u003e","displayNoNewLineWarning":false,"position":42,"left":1324,"right":1363},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1364,"text":"+\t\t * It would be logically cleaner to *always* use the inheritance","html":"+\u003cspan class=pl-c\u003e\t\t * It would be logically cleaner to *always* use the inheritance\u003c/span\u003e","displayNoNewLineWarning":false,"position":43,"left":1324,"right":1364},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1365,"text":"+\t\t * parent RTE as the nominal relation; but that RTE is not otherwise","html":"+\u003cspan class=pl-c\u003e\t\t * parent RTE as the nominal relation; but that RTE is not otherwise\u003c/span\u003e","displayNoNewLineWarning":false,"position":44,"left":1324,"right":1365},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1366,"text":"+\t\t * referenced in the plan in the non-partitioned inheritance case.","html":"+\u003cspan class=pl-c\u003e\t\t * referenced in the plan in the non-partitioned inheritance case.\u003c/span\u003e","displayNoNewLineWarning":false,"position":45,"left":1324,"right":1366},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1367,"text":"+\t\t * Instead the duplicate child RTE created by expand_inherited_rtentry","html":"+\u003cspan class=pl-c\u003e\t\t * Instead the duplicate child RTE created by expand_inherited_rtentry\u003c/span\u003e","displayNoNewLineWarning":false,"position":46,"left":1324,"right":1367},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1368,"text":"+\t\t * is used elsewhere in the plan, so using the original parent RTE","html":"+\u003cspan class=pl-c\u003e\t\t * is used elsewhere in the plan, so using the original parent RTE\u003c/span\u003e","displayNoNewLineWarning":false,"position":47,"left":1324,"right":1368},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1369,"text":"+\t\t * would give rise to confusing use of multiple aliases in EXPLAIN","html":"+\u003cspan class=pl-c\u003e\t\t * would give rise to confusing use of multiple aliases in EXPLAIN\u003c/span\u003e","displayNoNewLineWarning":false,"position":48,"left":1324,"right":1369},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1370,"text":"+\t\t * output for what the user will think is the \"same\" table. OTOH,","html":"+\u003cspan class=pl-c\u003e\t\t * output for what the user will think is the \u0026quot;same\u0026quot; table. OTOH,\u003c/span\u003e","displayNoNewLineWarning":false,"position":49,"left":1324,"right":1370},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1371,"text":"+\t\t * it's not a problem in the partitioned inheritance case, because the","html":"+\u003cspan class=pl-c\u003e\t\t * it\u0026#39;s not a problem in the partitioned inheritance case, because the\u003c/span\u003e","displayNoNewLineWarning":false,"position":50,"left":1324,"right":1371},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1372,"text":"+\t\t * duplicate child RTE added for the parent does not appear anywhere","html":"+\u003cspan class=pl-c\u003e\t\t * duplicate child RTE added for the parent does not appear anywhere\u003c/span\u003e","displayNoNewLineWarning":false,"position":51,"left":1324,"right":1372},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1373,"text":"+\t\t * else in the plan tree.","html":"+\u003cspan class=pl-c\u003e\t\t * else in the plan tree.\u003c/span\u003e","displayNoNewLineWarning":false,"position":52,"left":1324,"right":1373},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1374,"text":"+\t\t */","html":"+\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":53,"left":1324,"right":1374},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1375,"text":"+\t\tif (nominalRelation \u003c 0)","html":"+\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003enominalRelation\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026lt;\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":54,"left":1324,"right":1375},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1376,"text":"+\t\t\tnominalRelation = appinfo-\u003echild_relid;","html":"+\t\t\t\u003cspan class=pl-s1\u003enominalRelation\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003eappinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003echild_relid\u003c/span\u003e;","displayNoNewLineWarning":false,"position":55,"left":1324,"right":1376},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1377,"text":"+","html":"+","displayNoNewLineWarning":false,"position":56,"left":1324,"right":1377},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1378,"text":" \t\t/*","html":" \t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":57,"left":1325,"right":1378},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1379,"text":" \t\t * The rowMarks list might contain references to subquery RTEs, so","html":" \u003cspan class=pl-c\u003e\t\t * The rowMarks list might contain references to subquery RTEs, so\u003c/span\u003e","displayNoNewLineWarning":false,"position":58,"left":1326,"right":1379},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1380,"text":" \t\t * make a copy that we can apply ChangeVarNodes to. (Fortunately, the","html":" \u003cspan class=pl-c\u003e\t\t * make a copy that we can apply ChangeVarNodes to. (Fortunately, the\u003c/span\u003e","displayNoNewLineWarning":false,"position":59,"left":1327,"right":1380},{"stylingDirective":null,"type":"HUNK","blobLineNumber":1477,"text":"@@ -1425,56 +1478,9 @@ inheritance_planner(PlannerInfo *root)","html":"@@ -1425,56 +1478,9 @@ inheritance_planner(PlannerInfo *root)","displayNoNewLineWarning":false,"position":60,"left":1424,"right":1477},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1478,"text":" \t\t/* and we haven't created PlaceHolderInfos, either */","html":" \t\t\u003cspan class=pl-c\u003e/* and we haven\u0026#39;t created PlaceHolderInfos, either */\u003c/span\u003e","displayNoNewLineWarning":false,"position":61,"left":1425,"right":1478},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1479,"text":" \t\tAssert(subroot-\u003eplaceholder_list == NIL);","html":" \t\t\u003cspan class=pl-en\u003eAssert\u003c/span\u003e(\u003cspan class=pl-s1\u003esubroot\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003eplaceholder_list\u003c/span\u003e \u003cspan class=pl-c1\u003e==\u003c/span\u003e \u003cspan class=pl-c1\u003eNIL\u003c/span\u003e);","displayNoNewLineWarning":false,"position":62,"left":1426,"right":1479},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1480,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":63,"left":1427,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1428,"text":"-\t\t/*","html":"-\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":64,"left":1428,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1429,"text":"-\t\t * Mark if we're planning a query to a partitioned table or an","html":"-\u003cspan class=pl-c\u003e\t\t * Mark if we\u0026#39;re planning a query to a partitioned table or an\u003c/span\u003e","displayNoNewLineWarning":false,"position":65,"left":1429,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1430,"text":"-\t\t * inheritance parent.","html":"-\u003cspan class=pl-c\u003e\t\t * inheritance parent.\u003c/span\u003e","displayNoNewLineWarning":false,"position":66,"left":1430,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1431,"text":"-\t\t */","html":"-\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":67,"left":1431,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1432,"text":"-\t\tsubroot-\u003einhTargetKind =","html":"-\t\t\u003cspan class=pl-s1\u003esubroot\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003einhTargetKind\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e","displayNoNewLineWarning":false,"position":68,"left":1432,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1433,"text":"-\t\t\tpartitioned_relids ? INHKIND_PARTITIONED : INHKIND_INHERITED;","html":"-\t\t\t\u003cspan class=pl-s1\u003epartitioned_relids\u003c/span\u003e ? \u003cspan class=pl-c1\u003eINHKIND_PARTITIONED\u003c/span\u003e : \u003cspan class=pl-c1\u003eINHKIND_INHERITED\u003c/span\u003e;","displayNoNewLineWarning":false,"position":69,"left":1433,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1434,"text":"-","html":"-","displayNoNewLineWarning":false,"position":70,"left":1434,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1435,"text":"-\t\t/*","html":"-\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":71,"left":1435,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1436,"text":"-\t\t * If the child is further partitioned, remember it as a parent. Since","html":"-\u003cspan class=pl-c\u003e\t\t * If the child is further partitioned, remember it as a parent. Since\u003c/span\u003e","displayNoNewLineWarning":false,"position":72,"left":1436,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1437,"text":"-\t\t * a partitioned table does not have any data, we don't need to create","html":"-\u003cspan class=pl-c\u003e\t\t * a partitioned table does not have any data, we don\u0026#39;t need to create\u003c/span\u003e","displayNoNewLineWarning":false,"position":73,"left":1437,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1438,"text":"-\t\t * a plan for it. We do, however, need to remember the PlannerInfo for","html":"-\u003cspan class=pl-c\u003e\t\t * a plan for it. We do, however, need to remember the PlannerInfo for\u003c/span\u003e","displayNoNewLineWarning":false,"position":74,"left":1438,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1439,"text":"-\t\t * use when processing its children.","html":"-\u003cspan class=pl-c\u003e\t\t * use when processing its children.\u003c/span\u003e","displayNoNewLineWarning":false,"position":75,"left":1439,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1440,"text":"-\t\t */","html":"-\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":76,"left":1440,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1441,"text":"-\t\tif (child_rte-\u003einh)","html":"-\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003echild_rte\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003einh\u003c/span\u003e)","displayNoNewLineWarning":false,"position":77,"left":1441,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1442,"text":"-\t\t{","html":"-\t\t{","displayNoNewLineWarning":false,"position":78,"left":1442,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1443,"text":"-\t\t\tAssert(child_rte-\u003erelkind == RELKIND_PARTITIONED_TABLE);","html":"-\t\t\t\u003cspan class=pl-en\u003eAssert\u003c/span\u003e(\u003cspan class=pl-s1\u003echild_rte\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erelkind\u003c/span\u003e \u003cspan class=pl-c1\u003e==\u003c/span\u003e \u003cspan class=pl-c1\u003eRELKIND_PARTITIONED_TABLE\u003c/span\u003e);","displayNoNewLineWarning":false,"position":79,"left":1443,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1444,"text":"-\t\t\tparent_relids =","html":"-\t\t\t\u003cspan class=pl-s1\u003eparent_relids\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e","displayNoNewLineWarning":false,"position":80,"left":1444,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1445,"text":"-\t\t\t\tbms_add_member(parent_relids, appinfo-\u003echild_relid);","html":"-\t\t\t\t\u003cspan class=pl-en\u003ebms_add_member\u003c/span\u003e(\u003cspan class=pl-s1\u003eparent_relids\u003c/span\u003e, \u003cspan class=pl-s1\u003eappinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003echild_relid\u003c/span\u003e);","displayNoNewLineWarning":false,"position":81,"left":1445,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1446,"text":"-\t\t\tparent_roots[appinfo-\u003echild_relid] = subroot;","html":"-\t\t\t\u003cspan class=pl-s1\u003eparent_roots\u003c/span\u003e[\u003cspan class=pl-s1\u003eappinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003echild_relid\u003c/span\u003e] \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003esubroot\u003c/span\u003e;","displayNoNewLineWarning":false,"position":82,"left":1446,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1447,"text":"-","html":"-","displayNoNewLineWarning":false,"position":83,"left":1447,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1448,"text":"-\t\t\tcontinue;","html":"-\t\t\t\u003cspan class=pl-k\u003econtinue\u003c/span\u003e;","displayNoNewLineWarning":false,"position":84,"left":1448,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1449,"text":"-\t\t}","html":"-\t\t}","displayNoNewLineWarning":false,"position":85,"left":1449,"right":1480},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1450,"text":"-","html":"-","displayNoNewLineWarning":false,"position":86,"left":1450,"right":1480},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1481,"text":" \t\t/* Generate Path(s) for accessing this result relation */","html":" \t\t\u003cspan class=pl-c\u003e/* Generate Path(s) for accessing this result relation */\u003c/span\u003e","displayNoNewLineWarning":false,"position":87,"left":1451,"right":1481},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1482,"text":" \t\tgrouping_planner(subroot, true, 0.0 /* retrieve all tuples */ );","html":" \t\t\u003cspan class=pl-en\u003egrouping_planner\u003c/span\u003e(\u003cspan class=pl-s1\u003esubroot\u003c/span\u003e, true, \u003cspan class=pl-c1\u003e0.0\u003c/span\u003e \u003cspan class=pl-c\u003e/* retrieve all tuples */\u003c/span\u003e );","displayNoNewLineWarning":false,"position":88,"left":1452,"right":1482},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1483,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":89,"left":1453,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1454,"text":"-\t\t/*","html":"-\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":90,"left":1454,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1455,"text":"-\t\t * Set the nomimal target relation of the ModifyTable node if not","html":"-\u003cspan class=pl-c\u003e\t\t * Set the nomimal target relation of the ModifyTable node if not\u003c/span\u003e","displayNoNewLineWarning":false,"position":91,"left":1455,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1456,"text":"-\t\t * already done. We use the inheritance parent RTE as the nominal","html":"-\u003cspan class=pl-c\u003e\t\t * already done. We use the inheritance parent RTE as the nominal\u003c/span\u003e","displayNoNewLineWarning":false,"position":92,"left":1456,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1457,"text":"-\t\t * target relation if it's a partitioned table (see just above this","html":"-\u003cspan class=pl-c\u003e\t\t * target relation if it\u0026#39;s a partitioned table (see just above this\u003c/span\u003e","displayNoNewLineWarning":false,"position":93,"left":1457,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1458,"text":"-\t\t * loop). In the non-partitioned parent case, we'll use the first","html":"-\u003cspan class=pl-c\u003e\t\t * loop). In the non-partitioned parent case, we\u0026#39;ll use the first\u003c/span\u003e","displayNoNewLineWarni
8000
ng":false,"position":94,"left":1458,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1459,"text":"-\t\t * child relation (even if it's excluded) as the nominal target","html":"-\u003cspan class=pl-c\u003e\t\t * child relation (even if it\u0026#39;s excluded) as the nominal target\u003c/span\u003e","displayNoNewLineWarning":false,"position":95,"left":1459,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1460,"text":"-\t\t * relation. Because of the way expand_inherited_rtentry works, the","html":"-\u003cspan class=pl-c\u003e\t\t * relation. Because of the way expand_inherited_rtentry works, the\u003c/span\u003e","displayNoNewLineWarning":false,"position":96,"left":1460,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1461,"text":"-\t\t * latter should be the RTE representing the parent table in its role","html":"-\u003cspan class=pl-c\u003e\t\t * latter should be the RTE representing the parent table in its role\u003c/span\u003e","displayNoNewLineWarning":false,"position":97,"left":1461,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1462,"text":"-\t\t * as a simple member of the inheritance set.","html":"-\u003cspan class=pl-c\u003e\t\t * as a simple member of the inheritance set.\u003c/span\u003e","displayNoNewLineWarning":false,"position":98,"left":1462,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1463,"text":"-\t\t *","html":"-\u003cspan class=pl-c\u003e\t\t *\u003c/span\u003e","displayNoNewLineWarning":false,"position":99,"left":1463,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1464,"text":"-\t\t * It would be logically cleaner to *always* use the inheritance","html":"-\u003cspan class=pl-c\u003e\t\t * It would be logically cleaner to *always* use the inheritance\u003c/span\u003e","displayNoNewLineWarning":false,"position":100,"left":1464,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1465,"text":"-\t\t * parent RTE as the nominal relation; but that RTE is not otherwise","html":"-\u003cspan class=pl-c\u003e\t\t * parent RTE as the nominal relation; but that RTE is not otherwise\u003c/span\u003e","displayNoNewLineWarning":false,"position":101,"left":1465,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1466,"text":"-\t\t * referenced in the plan in the non-partitioned inheritance case.","html":"-\u003cspan class=pl-c\u003e\t\t * referenced in the plan in the non-partitioned inheritance case.\u003c/span\u003e","displayNoNewLineWarning":false,"position":102,"left":1466,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1467,"text":"-\t\t * Instead the duplicate child RTE created by expand_inherited_rtentry","html":"-\u003cspan class=pl-c\u003e\t\t * Instead the duplicate child RTE created by expand_inherited_rtentry\u003c/span\u003e","displayNoNewLineWarning":false,"position":103,"left":1467,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1468,"text":"-\t\t * is used elsewhere in the plan, so using the original parent RTE","html":"-\u003cspan class=pl-c\u003e\t\t * is used elsewhere in the plan, so using the original parent RTE\u003c/span\u003e","displayNoNewLineWarning":false,"position":104,"left":1468,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1469,"text":"-\t\t * would give rise to confusing use of multiple aliases in EXPLAIN","html":"-\u003cspan class=pl-c\u003e\t\t * would give rise to confusing use of multiple aliases in EXPLAIN\u003c/span\u003e","displayNoNewLineWarning":false,"position":105,"left":1469,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1470,"text":"-\t\t * output for what the user will think is the \"same\" table. OTOH,","html":"-\u003cspan class=pl-c\u003e\t\t * output for what the user will think is the \u0026quot;same\u0026quot; table. OTOH,\u003c/span\u003e","displayNoNewLineWarning":false,"position":106,"left":1470,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1471,"text":"-\t\t * it's not a problem in the partitioned inheritance case, because the","html":"-\u003cspan class=pl-c\u003e\t\t * it\u0026#39;s not a problem in the partitioned inheritance case, because the\u003c/span\u003e","displayNoNewLineWarning":false,"position":107,"left":1471,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1472,"text":"-\t\t * duplicate child RTE added for the parent does not appear anywhere","html":"-\u003cspan class=pl-c\u003e\t\t * duplicate child RTE added for the parent does not appear anywhere\u003c/span\u003e","displayNoNewLineWarning":false,"position":108,"left":1472,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1473,"text":"-\t\t * else in the plan tree.","html":"-\u003cspan class=pl-c\u003e\t\t * else in the plan tree.\u003c/span\u003e","displayNoNewLineWarning":false,"position":109,"left":1473,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1474,"text":"-\t\t */","html":"-\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":110,"left":1474,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1475,"text":"-\t\tif (nominalRelation \u003c 0)","html":"-\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003enominalRelation\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026lt;\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":111,"left":1475,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1476,"text":"-\t\t\tnominalRelation = appinfo-\u003echild_relid;","html":"-\t\t\t\u003cspan class=pl-s1\u003enominalRelation\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003eappinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003echild_relid\u003c/span\u003e;","displayNoNewLineWarning":false,"position":112,"left":1476,"right":1483},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1477,"text":"-","html":"-","displayNoNewLineWarning":false,"position":113,"left":1477,"right":1483},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1484,"text":" \t\t/*","html":" \t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":114,"left":1478,"right":1484},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1485,"text":" \t\t * Select cheapest path in case there's more than one. We always run","html":" \u003cspan class=pl-c\u003e\t\t * Select cheapest path in case there\u0026#39;s more than one. We always run\u003c/span\u003e","displayNoNewLineWarning":false,"position":115,"left":1479,"right":1485},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1486,"text":" \t\t * modification queries to conclusion, so we care only for the","html":" \u003cspan class=pl-c\u003e\t\t * modification queries to conclusion, so we care only for the\u003c/span\u003e","displayNoNewLineWarning":false,"position":116,"left":1480,"right":1486},{"stylingDirective":null,"type":"HUNK","blobLineNumber":1497,"text":"@@ -1492,9 +1498,9 @@ inheritance_planner(PlannerInfo *root)","html":"@@ -1492,9 +1498,9 @@ inheritance_planner(PlannerInfo *root)","displayNoNewLineWarning":false,"position":117,"left":1491,"right":1497},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1498,"text":" \t\t\tcontinue;","html":" \t\t\t\u003cspan class=pl-k\u003econtinue\u003c/span\u003e;","displayNoNewLineWarning":false,"position":118,"left":1492,"right":1498},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1499,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":119,"left":1493,"right":1499},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1500,"text":" \t\t/*","html":" \t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":120,"left":1494,"right":1500},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1495,"text":"-\t\t * Add the current parent's RT index to the partitione_rels set if","html":"-\u003cspan class=\"pl-c\"\u003e\t\t * Add the current parent's RT index to the \u003cspan class=\"x x-first x-last\"\u003epartitione_rels\u003c/span\u003e set if\u003c/span\u003e","displayNoNewLineWarning":false,"position":121,"left":1495,"right":1500},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1496,"text":"-\t\t * we're going to create the ModifyTable path for a partitioned root","html":"-\u003cspan class=\"pl-c\"\u003e\t\t * we're \u003cspan class=\"x x-first x-last\"\u003egoing to create \u003c/span\u003ethe ModifyTable path for a partitioned root\u003c/span\u003e","displayNoNewLineWarning":false,"position":122,"left":1496,"right":1500},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1497,"text":"-\t\t * table.","html":"-\u003cspan class=\"pl-c\"\u003e\t\t * \u003cspan class=\"x x-first x-last\"\u003etable.\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":123,"left":1497,"right":1500},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1501,"text":"+\t\t * Add the current parent's RT index to the partitioned_relids set if","html":"+\u003cspan class=\"pl-c\"\u003e\t\t * Add the current parent's RT index to the \u003cspan class=\"x x-first x-last\"\u003epartitioned_relids\u003c/span\u003e set if\u003c/span\u003e","displayNoNewLineWarning":false,"position":124,"left":1497,"right":1501},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1502,"text":"+\t\t * we're creating the ModifyTable path for a partitioned root table.","html":"+\u003cspan class=\"pl-c\"\u003e\t\t * we're \u003cspan class=\"x x-first x-last\"\u003ecreating \u003c/span\u003ethe ModifyTable path for a partitioned root\u003cspan class=\"x x-first x-last\"\u003e table.\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":125,"left":1497,"right":1502},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1503,"text":"+\t\t * (We only care about parents of non-excluded children.)","html":"+\u003cspan class=\"pl-c\"\u003e\t\t * \u003cspan class=\"x x-first x-last\"\u003e(We only care about parents of non-excluded children.)\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":126,"left":1497,"right":1503},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1504,"text":" \t\t */","html":" \u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":127,"left":1498,"right":1504},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1505,"text":" \t\tif (partitioned_relids)","html":" \t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003epartitioned_relids\u003c/span\u003e)","displayNoNewLineWarning":false,"position":128,"left":1499,"right":1505},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1506,"text":" \t\t\tpartitioned_relids = bms_add_member(partitioned_relids,","html":" \t\t\t\u003cspan class=pl-s1\u003epartitioned_relids\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003ebms_add_member\u003c/span\u003e(\u003cspan class=pl-s1\u003epartitioned_relids\u003c/span\u003e,","displayNoNewLineWarning":false,"position":129,"left":1500,"right":1506}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":7197,"linesChanged":106,"newTreeEntry":{"lineCount":7197,"path":"src/backend/optimizer/plan/planner.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/optimizer/plan/planner.c","mode":100644},"linesAdded":56,"linesDeleted":50,"path":"src/backend/optimizer/plan/planner.c","pathDigest":"c6e13617216e8b159a017b78dea5eae9966e17e98e0ba6e818a352ecac5bbcf7","status":"MODIFIED","truncatedReason":null,"oldOid":"a2a8acd15217b1e355c083a41da4dc5c7f35b30b","newOid":"4a2994f055be9405a254b22de6cd2107a0f46563","copilotChatReference":null,"deletedSha":"a2a8acd15217b1e355c083a41da4dc5c7f35b30b","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":1721,"text":"@@ -1722,6 +1722,49 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_l WHERE a = 1 AND a = 2)","html":"@@ -1722,6 +1722,49 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_l WHERE a = 1 AND a = 2)","displayNoNewLineWarning":false,"position":0,"left":1721,"right":1721},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1722,"text":" One-Time Filter: false","html":" One-Time Filter: false","displayNoNewLineWarning":false,"position":1,"left":1722,"right":1722},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1723,"text":" (11 rows)","html":" (11 rows)","displayNoNewLineWarning":false,"position":2,"left":1723,"right":1723},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1724,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":3,"left":1724,"right":1724},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1725,"text":"+-- Test case to verify proper handling of subqueries in a partitioned delete.","html":"+-- Test case to verify proper handling of subqueries in a partitioned delete.","displayNoNewLineWarning":false,"position":4,"left":1724,"right":1725},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1726,"text":"+-- The weird-looking lateral join is just there to force creation of a","html":"+-- The weird-looking lateral join is just there to force creation of a","displayNoNewLineWarning":false,"position":5,"left":1724,"right":1726},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1727,"text":"+-- nestloop parameter within the subquery, which exposes the problem if the","html":"+-- nestloop parameter within the subquery, which exposes the problem if the","displayNoNewLineWarning":false,"position":6,"left":1724,"right":1727},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1728,"text":"+-- planner fails to make multiple copies of the subquery as appropriate.","html":"+-- planner fails to make multiple copies of the subquery as appropriate.","displayNoNewLineWarning":false,"position":7,"left":1724,"right":1728},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1729,"text":"+EXPLAIN (COSTS OFF)","html":"+EXPLAIN (COSTS OFF)","displayNoNewLineWarning":false,"position":8,"left":1724,"right":1729},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1730,"text":"+DELETE FROM prt1_l","html":"+DELETE FROM prt1_l","displayNoNewLineWarning":false,"position":9,"left":1724,"right":1730},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1731,"text":"+WHERE EXISTS (","html":"+WHERE EXISTS (","displayNoNewLineWarning":false,"position":10,"left":1724,"right":1731},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1732,"text":"+ SELECT 1","html":"+ SELECT 1","displayNoNewLineWarning":false,"position":11,"left":1724,"right":1732},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1733,"text":"+ FROM int4_tbl,","html":"+ FROM int4_tbl,","displayNoNewLineWarning":false,"position":12,"left":1724,"right":1733},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1734,"text":"+ LATERAL (SELECT int4_tbl.f1 FROM int8_tbl LIMIT 2) ss","html":"+ LATERAL (SELECT int4_tbl.f1 FROM int8_tbl LIMIT 2) ss","displayNoNewLineWarning":false,"position":13,"left":1724,"right":1734},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1735,"text":"+ WHERE prt1_l.c IS NULL);","html":"+ WHERE prt1_l.c IS NULL);","displayNoNewLineWarning":false,"position":14,"left":1724,"right":1735},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1736,"text":"+ QUERY PLAN ","html":"+ QUERY PLAN ","displayNoNewLineWarning":false,"position":15,"left":1724,"right":1736},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1737,"text":"+---------------------------------------------------------------","html":"+---------------------------------------------------------------","displayNoNewLineWarning":false,"position":16,"left":1724,"right":1737},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1738,"text":"+ Delete on prt1_l","html":"+ Delete on prt1_l","displayNoNewLineWarning":false,"position":17,"left":1724,"right":1738},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1739,"text":"+ Delete on prt1_l_p1","html":"+ Delete on prt1_l_p1","displayNoNewLineWarning":false,"position":18,"left":1724,"right":1739},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1740,"text":"+ Delete on prt1_l_p3_p1","html":"+ Delete on prt1_l_p3_p1","displayNoNewLineWarning":false,"position":19,"left":1724,"right":1740},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1741,"text":"+ Delete on prt1_l_p3_p2","html":"+ Delete on prt1_l_p3_p2","displayNoNewLineWarning":false,"position":20,"left":1724,"right":1741},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1742,"text":"+ -\u003e Nested Loop Semi Join","html":"+ -\u0026gt; Nested Loop Semi Join","displayNoNewLineWarning":false,"position":21,"left":1724,"right":1742},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1743,"text":"+ -\u003e Seq Scan on prt1_l_p1","html":"+ -\u0026gt; Seq Scan on prt1_l_p1","displayNoNewLineWarning":false,"position":22,"left":1724,"right":1743},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1744,"text":"+ Filter: (c IS NULL)","html":"+ Filter: (c IS NULL)","displayNoNewLineWarning":false,"position":23,"left":1724,"right":1744},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1745,"text":"+ -\u003e Nested Loop","html":"+ -\u0026gt; Nested Loop","displayNoNewLineWarning":false,"position":24,"left":1724,"right":1745},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1746,"text":"+ -\u003e Seq Scan on int4_tbl","html":"+ -\u0026gt; Seq Scan on int4_tbl","displayNoNewLineWarning":false,"position":25,"left":1724,"right":1746},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1747,"text":"+ -\u003e Subquery Scan on ss","html":"+ -\u0026gt; Subquery Scan on ss","displayNoNewLineWarning":false,"position":26,"left":1724,"right":1747},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1748,"text":"+ -\u003e Limit","html":"+ -\u0026gt; Limit","displayNoNewLineWarning":false,"position":27,"left":1724,"right":1748},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1749,"text":"+ -\u003e Seq Scan on int8_tbl","html":"+ -\u0026gt; Seq Scan on int8_tbl","displayNoNewLineWarning":false,"position":28,"left":1724,"right":1749},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1750,"text":"+ -\u003e Nested Loop Semi Join","html":"+ -\u0026gt; Nested Loop Semi Join","displayNoNewLineWarning":false,"position":29,"left":1724,"right":1750},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1751,"text":"+ -\u003e Seq Scan on prt1_l_p3_p1","html":"+ -\u0026gt; Seq Scan on prt1_l_p3_p1","displayNoNewLineWarning":false,"position":30,"left":1724,"right":1751},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1752,"text":"+ Filter: (c IS NULL)","html":"+ Filter: (c IS NULL)","displayNoNewLineWarning":false,"position":31,"left":1724,"right":1752},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1753,"text":"+ -\u003e Nested Loop","html":"+ -\u0026gt; Nested Loop","displayNoNewLineWarning":false,"position":32,"left":1724,"right":1753},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1754,"text":"+ -\u003e Seq Scan on int4_tbl","html":"+ -\u0026gt; Seq Scan on int4_tbl","displayNoNewLineWarning":false,"position":33,"left":1724,"right":1754},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1755,"text":"+ -\u003e Subquery Scan on ss_1","html":"+ -\u0026gt; Subquery Scan on ss_1","displayNoNewLineWarning":false,"position":34,"left":1724,"right":1755},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1756,"text":"+ -\u003e Limit","html":"+ -\u0026gt; Limit","displayNoNewLineWarning":false,"position":35,"left":1724,"right":1756},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1757,"text":"+ -\u003e Seq Scan on int8_tbl int8_tbl_1","html":"+ -\u0026gt; Seq Scan on int8_tbl int8_tbl_1","displayNoNewLineWarning":false,"position":36,"left":1724,"right":1757},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1758,"text":"+ -\u003e Nested Loop Semi Join","html":"+ -\u0026gt; Nested Loop Semi Join","displayNoNewLineWarning":false,"position":37,"left":1724,"right":1758},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1759,"text":"+ -\u003e Seq Scan on prt1_l_p3_p2","html":"+ -\u0026gt; Seq Scan on prt1_l_p3_p2","displayNoNewLineWarning":false,"position":38,"left":1724,"right":1759},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1760,"text":"+ Filter: (c IS NULL)","html":"+ Filter: (c IS NULL)","displayNoNewLineWarning":false,"position":39,"left":1724,"right":1760},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1761,"text":"+ -\u003e Nested Loop","html":"+ -\u0026gt; Nested Loop","displayNoNewLineWarning":false,"position":40,"left":1724,"right":1761},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1762,"text":"+ -\u003e Seq Scan on int4_tbl","html":"+ -\u0026gt; Seq Scan on int4_tbl","displayNoNewLineWarning":false,"position":41,"left":1724,"right":1762},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1763,"text":"+ -\u003e Subquery Scan on ss_2","html":"+ -\u0026gt; Subquery Scan on ss_2","displayNoNewLineWarning":false,"position":42,"left":1724,"right":1763},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1764,"text":"+ -\u003e Limit","html":"+ -\u0026gt; Limit","displayNoNewLineWarning":false,"position":43,"left":1724,"right":1764},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1765,"text":"+ -\u003e Seq Scan on int8_tbl int8_tbl_2","html":"+ -\u0026gt; Seq Scan on int8_tbl int8_tbl_2","displayNoNewLineWarning":false,"position":44,"left":1724,"right":1765},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1766,"text":"+(28 rows)","html":"+(28 rows)","displayNoNewLineWarning":false,"position":45,"left":1724,"right":1766},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1767,"text":"+","html":"+","displayNoNewLineWarning":false,"position":46,"left":1724,"right":1767},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1768,"text":" --","html":" --","displayNoNewLineWarning":false,"position":47,"left":1725,"right":1768},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1769,"text":" -- negative testcases","html":" -- negative testcases","displayNoNewLineWarning":false,"position":48,"left":1726,"right":1769},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1770,"text":" --","html":" --","displayNoNewLineWarning":false,"position":49,"left":1727,"right":1770}],"diffNumber":1,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":1999,"linesChanged":43,"newTreeEntry":{"lineCount":1999,"path":"src/test/regress/expected/partition_join.out","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/test/regress/expected/partition_join.out","mode":100644},"linesAdded":43,"linesDeleted":0,"path":"src/test/regress/expected/partition_join.out","pathDigest":"4fbd911ce0fe9dec95599a324d8d900189ce7ab1a42cca33aa0cdaf60eeec07e","status":"MODIFIED","truncatedReason":null,"oldOid":"a2a8acd15217b1e355c083a41da4dc5c7f35b30b","newOid":"4a2994f055be9405a254b22de6cd2107a0f46563","copilotChatReference":null,"deletedSha":"a2a8acd15217b1e355c083a41da4dc5c7f35b30b","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":339,"text":"@@ -340,6 +340,18 @@ SELECT * FROM prt1_l t1 LEFT JOIN LATERAL","html":"@@ -340,6 +340,18 @@ SELECT * FROM prt1_l t1 LEFT JOIN LATERAL","displayNoNewLineWarning":false,"position":0,"left":339,"right":339},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":340,"text":" EXPLAIN (COSTS OFF)","html":" EXPLAIN (COSTS OFF)","displayNoNewLineWarning":false,"position":1,"left":340,"right":340},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":341,"text":" SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_l WHERE a = 1 AND a = 2) t1 RIGHT JOIN prt2_l t2 ON t1.a = t2.b AND t1.b = t2.a AND t1.c = t2.c;","html":" \u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003et1\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003ea\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003et1\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003ec\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003et2\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eb\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003et2\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003ec\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e (\u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e prt1_l \u003cspan class=\"pl-k\"\u003eWHERE\u003c/span\u003e a \u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eAND\u003c/span\u003e a \u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e) t1 \u003cspan class=\"pl-k\"\u003eRIGHT JOIN\u003c/span\u003e prt2_l t2 \u003cspan class=\"pl-k\"\u003eON\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003et1\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003ea\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003et2\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eb\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eAND\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003et1\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eb\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003et2\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003ea\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eAND\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003et1\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003ec\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003et2\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003ec\u003c/span\u003e;","displayNoNewLineWarning":false,"position":2,"left":341,"right":341},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":342,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":3,"left":342,"right":342},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":343,"text":"+-- Test case to verify proper handling of subqueries in a partitioned delete.","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e Test case to verify proper handling of subqueries in a partitioned delete.\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":342,"right":343},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":344,"text":"+-- The weird-looking lateral join is just there to force creation of a","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e The weird-looking lateral join is just there to force creation of a\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":342,"right":344},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":345,"text":"+-- nestloop parameter within the subquery, which exposes the problem if the","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e nestloop parameter within the subquery, which exposes the problem if the\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":342,"right":345},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":346,"text":"+-- planner fails to make multiple copies of the subquery as appropriate.","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e planner fails to make multiple copies of the subquery as appropriate.\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":342,"right":346},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":347,"text":"+EXPLAIN (COSTS OFF)","html":"+EXPLAIN (COSTS OFF)","displayNoNewLineWarning":false,"position":8,"left":342,"right":347},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":348,"text":"+DELETE FROM prt1_l","html":"+\u003cspan class=\"pl-k\"\u003eDELETE\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e prt1_l","displayNoNewLineWarning":false,"position":9,"left":342,"right":348},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":349,"text":"+WHERE EXISTS (","html":"+\u003cspan class=\"pl-k\"\u003eWHERE\u003c/span\u003e EXISTS (","displayNoNewLineWarning":false,"position":10,"left":342,"right":349},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":350,"text":"+ SELECT 1","html":"+ \u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e","displayNoNewLineWarning":false,"position":11,"left":342,"right":350},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":351,"text":"+ FROM int4_tbl,","html":"+ \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e int4_tbl,","displayNoNewLineWarning":false,"position":12,"left":342,"right":351},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":352,"text":"+ LATERAL (SELECT int4_tbl.f1 FROM int8_tbl LIMIT 2) ss","html":"+ LATERAL (\u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eint4_tbl\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003ef1\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e int8_tbl \u003cspan class=\"pl-k\"\u003eLIMIT\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e) ss","displayNoNewLineWarning":false,"position":13,"left":342,"right":352},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":353,"text":"+ WHERE prt1_l.c IS NULL);","html":"+ \u003cspan class=\"pl-k\"\u003eWHERE\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eprt1_l\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003ec\u003c/span\u003e IS \u003cspan class=\"pl-k\"\u003eNULL\u003c/span\u003e);","displayNoNewLineWarning":false,"position":14,"left":342,"right":353},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":354,"text":"+","html":"+","displayNoNewLineWarning":false,"position":15,"left":342,"right":354},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":355,"text":" --","html":" \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":16,"left":343,"right":355},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":356,"text":" -- negative testcases","html":" \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e negative testcases\u003c/span\u003e","displayNoNewLineWarning":false,"position":17,"left":344,"right":356},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":357,"text":" --","html":" \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":18,"left":345,"right":357}],"diffNumber":2,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":428,"linesChanged":12,"newT
8000
reeEntry":{"lineCount":428,"path":"src/test/regress/sql/partition_join.sql","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/test/regress/sql/partition_join.sql","mode":100644},"linesAdded":12,"linesDeleted":0,"path":"src/test/regress/sql/partition_join.sql","pathDigest":"ce88ba90467b6c06bb4485eacdc63ac9e9bd7f5466a56e49ef90d540e3ec7758","status":"MODIFIED","truncatedReason":null,"oldOid":"a2a8acd15217b1e355c083a41da4dc5c7f35b30b","newOid":"4a2994f055be9405a254b22de6cd2107a0f46563","copilotChatReference":null,"deletedSha":"a2a8acd15217b1e355c083a41da4dc5c7f35b30b","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/4a2994f055be9405a254b22de6cd2107a0f46563","fileTreeExpanded":true,"headerInfo":{"additions":111,"deletions":50,"filesChanged":3,"filesChangedString":"3"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":3,"truncated":false,"byteCount":8302,"lineShownCount":199},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"t9Jxkp2pIDJx2xK68npgw3Jz4Q12BUbKKVo8-rU6uuUPqRs4EUXIAEIjirWcC0tsTx24zfTKOE1gFp1KibInUA"},"/users/diffview?diff=unified":{"post":"78-U_QyiQfr7KMr0c5R3lH8enstjc-K5wnTcFmYHvuRXtP5XgE6pyMjQUvsd5Vw7QnDHC-G8nD6LOH2mWo8jUQ"},"/notifications/thread":{"post":"sI0KgQ3w35q-QjmUQkhhNq_UMhrImfuRdwdoWYdSfzO92-C0NS7svrgnOg6c7iSmyJQDIfwNW3l1J4p7bzf4qQ"}}},"title":"Fix wrong order of operations in inheritance_planner. · postgres/postgres@4a2994f","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}
Fix wrong order of operations in inheritance_planner.
When considering a partitioning parent rel, we should stop processing that
subroot as soon as we've done adjust_appendrel_attrs and any securityQuals
updates. The rest of this is unnecessary, and indeed adding duplicate
subquery RTEs to the subroot is *wrong*. As the code stood, the children
of that partition ended up with two sets of copied subquery RTEs, confusing
matters greatly. Even more hilarity ensued if all of the children got
excluded by constraint exclusion, so that the extra RTEs didn't make it
back into the parent rtable.
Per fuzz testing by Andreas Seltenreich. Back-patch to v11 where this
got broken (by commit 0a48050, it looks like).
Discussion: https://postgr.es/m/87va8g7vq0.fsf@ansel.ydns.eu
0 commit comments