Re: Missing Column names with multi-insert

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Missing Column names with multi-insert
Дата
Msg-id 7708.1550519369@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Missing Column names with multi-insert  (Liz Frost <web@stillinbeta.com>)
Список 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 по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Missing Column names with multi-insert
Следующее
От: Petr Jelinek
Дата:
Сообщение: Re: unconstify equivalent for volatile