Liz Frost <web@stillinbeta.com> writes:
> I'm working on a foreign data wrapper that uses INSERT, and I noticed some
> odd behaviour. If I insert just one row, the
> TupleDesc->attr[0]->attname.data has the column names in it. However, in a
> multi-row string, all those are empty strings:
There's not really any expectation that those be valid info during
planning. The parser has a substantially different code path for
single-row INSERT than multi-row (mostly to minimize overhead for the
single-row case), and probably somewhere in there is the reason why
these happen to show up as valid in that case.
If you want column names, the eref field of RTEs is usually the right
place to look.
> Am I missing something obvious? Is this a bug?
I don't think it's a bug.
regards, tom lane