tle = get_tle_by_resno(dpns->inner_tlist, var->varattno);
if (!tle)
- elog(ERROR, "bogus varattno for subquery var: %d", var->varattno);
+ elog(ERROR, "invalid attnum %d for relation \"%s\"",
+ var->varattno, rte->eref->aliasname);
Assert(netlevelsup == 0);
push_child_plan(dpns, dpns->inner_planstate, &save_dpns);
else if (attnum > 0)
{
/* Get column name to use from the colinfo struct */
- Assert(attnum <= colinfo->num_cols);
+ if (attnum > colinfo->num_cols)
+ elog(ERROR, "invalid attnum %d for relation \"%s\"",
+ attnum, rte->eref->aliasname);
attname = colinfo->colnames[attnum - 1];
- Assert(attname != NULL);
+ if (attname == NULL) /* dropped column? */
+ elog(ERROR, "invalid attnum %d for relation \"%s\"",
+ attnum, rte->eref->aliasname);
}
else
{