Re: Missing Column names with multi-insert - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Missing Column names with multi-insert
Date
Msg-id 7708.1550519369@sss.pgh.pa.us
Whole thread Raw
In response to Missing Column names with multi-insert  (Liz Frost <web@stillinbeta.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Missing Column names with multi-insert
Next
From: Petr Jelinek
Date:
Subject: Re: unconstify equivalent for volatile