Robert Haas <robertmhaas@gmail.com> writes:
> I believe that you'd want to have happen here is for each child to
> emit the row identity columns that it knows about, and emit NULL for
> the others. Then when you do the Append you end up with a row format
> that includes all the individual identity columns, but for any
> particular tuple, only one set of such columns is populated and the
> others are all NULL.
Yeah, that was what I'd imagined in my earlier thinking about this.
> There doesn't seem to be any execution-time
> problem with such a representation, but there might be a planning-time
> problem with building it,
Possibly. We manage to cope with not-all-alike children now, of course,
but I think it might be true that no one plan node has Vars from
dissimilar children. Even so, the Vars are self-identifying, so it
seems like this ought to be soluble.
regards, tom lane