Hi,
I've applied your patch. I think it's reasonable.
but IMHO It looks more complicated to read because of many conditions
in if statement.
so what about just moving up if-statement?
No.
Your version is worse than HEAD, please don't.
1. Do not declare variables after statement.
Although Postgres accepts C99, this is not acceptable, for a number of problems, already discussed.
2. Still slow unnecessarily, because still test TupleDescAttr(tupleDesc, i)->attlen,
which is much more onerous than test isnull.
3. We don't write Baby C code.
C has short break expressions, use-it!
My version is the right thing, here.
regards,
Ranier Vilela