Re: Missing Column names with multi-insert

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Liz Frost <web(at)stillinbeta(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Missing Column names with multi-insert
Date: 2019-02-18 19:49:29
Message-ID: 7708.1550519369@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Liz Frost <web(at)stillinbeta(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2019-02-18 20:18:42 Re: unconstify equivalent for volatile
Previous Message Andres Freund 2019-02-18 19:47:21 Re: Missing Column names with multi-insert