Commit bc9d4ec9 authored by Tom Lane's avatar Tom Lane

optimize_minmax_aggregates() neglected to check for inherited tables.

Per report from Cesar Paipilla.
parent 99bb9c55
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.8 2005/08/18 17:51:11 tgl Exp $ * $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.9 2005/09/21 19:15:27 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -113,7 +113,7 @@ optimize_minmax_aggregates(PlannerInfo *root, List *tlist, Path *best_path) ...@@ -113,7 +113,7 @@ optimize_minmax_aggregates(PlannerInfo *root, List *tlist, Path *best_path)
if (!IsA(rtr, RangeTblRef)) if (!IsA(rtr, RangeTblRef))
return NULL; return NULL;
rte = rt_fetch(rtr->rtindex, parse->rtable); rte = rt_fetch(rtr->rtindex, parse->rtable);
if (rte->rtekind != RTE_RELATION) if (rte->rtekind != RTE_RELATION || rte->inh)
return NULL; return NULL;
rel = find_base_rel(root, rtr->rtindex); rel = find_base_rel(root, rtr->rtindex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment