ste = get_tle_by_resno(GetCTETargetList(cte), attnum);
                if (ste == NULL || ste->resjunk)
-                   elog(ERROR, "subquery %s does not have attribute %d",
+                   elog(ERROR, "CTE %s does not have attribute %d",
                         rte->eref->aliasname, attnum);
                tle->resorigtbl = ste->resorigtbl;
                tle->resorigcol = ste->resorigcol;
 
                ste = get_tle_by_resno(GetCTETargetList(cte), attnum);
                if (ste == NULL || ste->resjunk)
-                   elog(ERROR, "subquery %s does not have attribute %d",
+                   elog(ERROR, "CTE %s does not have attribute %d",
                         rte->eref->aliasname, attnum);
                expr = (Node *) ste->expr;
                if (IsA(expr, Var))