Consistently use "superuser" instead of "super user"
[pgsql.git] / src / include / access / attmap.h
blob778fa27fd163b077af0d24320e828959f65d6b0f
1 /*-------------------------------------------------------------------------
3 * attmap.h
4 * Definitions for PostgreSQL attribute mappings
7 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/access/attmap.h
12 *-------------------------------------------------------------------------
14 #ifndef ATTMAP_H
15 #define ATTMAP_H
17 #include "access/attnum.h"
18 #include "access/tupdesc.h"
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.
34 typedef struct AttrMap
36 AttrNumber *attnums;
37 int maplen;
38 } AttrMap;
40 extern AttrMap *make_attrmap(int maplen);
41 extern void free_attrmap(AttrMap *map);
43 /* Conversion routines to build mappings */
44 extern AttrMap *build_attrmap_by_name(TupleDesc indesc,
45 TupleDesc outdesc);
46 extern AttrMap *build_attrmap_by_name_if_req(TupleDesc indesc,
47 TupleDesc outdesc);
48 extern AttrMap *build_attrmap_by_position(TupleDesc indesc,
49 TupleDesc outdesc,
50 const char *msg);
52 #endif /* ATTMAP_H */