Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes16kdownloads
attmap.h55 linesDownload Raw Back to access
1/*-------------------------------------------------------------------------2 *3 * attmap.h4 *	  Definitions for PostgreSQL attribute mappings5 *6 *7 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group8 * Portions Copyright (c) 1994, Regents of the University of California9 *10 * src/include/access/attmap.h11 *12 *-------------------------------------------------------------------------13 */14#ifndef ATTMAP_H15#define ATTMAP_H16 17#include "access/attnum.h"18#include "access/tupdesc.h"19 20/*21 * Attribute mapping structure22 *23 * This maps attribute numbers between a pair of relations, designated24 * 'input' and 'output' (most typically inheritance parent and child25 * relations), whose common columns may have different attribute numbers.26 * Such difference may arise due to the columns being ordered differently27 * in the two relations or the two relations having dropped columns at28 * different positions.29 *30 * 'maplen' is set to the number of attributes of the 'output' relation,31 * taking into account any of its dropped attributes, with the corresponding32 * elements of the 'attnums' array set to 0.33 */34typedef struct AttrMap35{36	AttrNumber *attnums;37	int			maplen;38} AttrMap;39 40extern AttrMap *make_attrmap(int maplen);41extern void free_attrmap(AttrMap *map);42 43/* Conversion routines to build mappings */44extern AttrMap *build_attrmap_by_name(TupleDesc indesc,45									  TupleDesc outdesc,46									  bool missing_ok);47extern AttrMap *build_attrmap_by_name_if_req(TupleDesc indesc,48											 TupleDesc outdesc,49											 bool missing_ok);50extern AttrMap *build_attrmap_by_position(TupleDesc indesc,51										  TupleDesc outdesc,52										  const char *msg);53 54#endif							/* ATTMAP_H */55 
codekingpro/portable-devtools · Team Ai