Thread: pgsql: Include column name in build_attrmap_by_position's error reports

Include column name in build_attrmap_by_position's error reports.

Formerly we only provided the column number, but it's frequently
more useful to mention the column name.  The input tupdesc often
doesn't have useful column names, but the output tupdesc usually
contains user-supplied names, so report that one.

Author: Marcos Pegoraro <marcos@f10.com.br>
Co-authored-by: jian he <jian.universality@gmail.com>
Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us>
Co-authored-by: Erik Wienhold <ewie@ewie.name>
Reviewed-by: Vladlen Popolitov <v.popolitov@postgrespro.ru>
Discussion: https://postgr.es/m/CAB-JLwanky28gjAMdnMh1CjyO1b2zLdr6UOA1-oY9G7PVL9KKQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/34c3c5ce1c0b2a27de212076c2e5aaa8e82fac31

Modified Files
--------------
src/backend/access/common/attmap.c             | 28 ++++++++++++--------------
src/pl/plpgsql/src/expected/plpgsql_record.out | 26 +++++++++++++++++-------
src/pl/plpgsql/src/sql/plpgsql_record.sql      |  8 ++++++++
src/test/regress/expected/plpgsql.out          |  2 +-
4 files changed, 41 insertions(+), 23 deletions(-)