"Pavel Stehule" <pavel.stehule@gmail.com> writes:
> I thing so Agg node doesn't set width well:
The planner doesn't really bother to set the width correctly for any
expression-computing node. This is partly laziness, but OTOH it is
very hard to estimate a sane width for any function returning a
variable-width data type; eg what are the odds of a useful answer forselect repeat(textcol, intcol) from tab1;
For plan nodes that return just Vars it's easier, since we generally
have got stats about average column widths.
I think Agg just copies the width of its input ...
regards, tom lane