Michael Paquier <michael.paquier@gmail.com> writes:
> I have poked at this bug report yesterday and today, and found that it
> is as well possible to hit the second assertion two lines below with a
> dropped column. So I would like to propose the patch attached to
> replace both assertions with an elog(ERROR).
There's a quite similar error check just a few lines above that prints
elog(ERROR, "bogus varattno for subquery var: %d", var->varattno);
I'm not necessarily wedded to that exact phrasing, but I think these new
error messages should be consistent with that one. I'm a bit inclined
to make all three of them read like
elog(ERROR, "invalid attnum %d for table \"%s\"",
attnum, rte->eref->aliasname);
> Test cases are included,
> though I am not sure if they bring much value.
Yeah, I can't get very excited about memorializing those.
regards, tom lane