1/*-------------------------------------------------------------------------
4 * Definitions for PostgreSQL attribute mappings
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/access/attmap.h
12 *-------------------------------------------------------------------------
21 * Attribute mapping structure
23 * This maps attribute numbers between a pair of relations, designated
24 * 'input' and 'output' (most typically inheritance parent and child
25 * relations), whose common columns may have different attribute numbers.
26 * Such difference may arise due to the columns being ordered differently
27 * in the two relations or the two relations having dropped columns at
28 * different positions.
30 * 'maplen' is set to the number of attributes of the 'output' relation,
31 * taking into account any of its dropped attributes, with the corresponding
32 * elements of the 'attnums' array set to 0.
43/* Conversion routines to build mappings */
void free_attrmap(AttrMap *map)
AttrMap * make_attrmap(int maplen)
AttrMap * build_attrmap_by_name(TupleDesc indesc, TupleDesc outdesc, bool missing_ok)
AttrMap * build_attrmap_by_name_if_req(TupleDesc indesc, TupleDesc outdesc, bool missing_ok)
AttrMap * build_attrmap_by_position(TupleDesc indesc, TupleDesc outdesc, const char *msg)