On Fri, Jul 1, 2016 at 5:42 AM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> Maybe the attnum bounds check should be an error rather than an
> assertion, like in the attached. Thought perhaps with a better
> message...
Quite interesting report. It looks right to me to do so with an elog(ERROR).
+ if (attnum > colinfo->num_cols)
+ elog(ERROR, "cannot decompile bogus attnum: %d", attnum);
Why not "incorrect number of arguments: specified %d but found %d" instead?
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). Test cases are included,
though I am not sure if they bring much value.
--
Michael