diff options
| author | Marc G. Fournier <scrappy@hub.org> | 1996-08-27 21:50:29 +0000 |
|---|---|---|
| committer | Marc G. Fournier <scrappy@hub.org> | 1996-08-27 21:50:29 +0000 |
| commit | 5a8820efcd9ae853de8ae711412218c7059d3358 (patch) | |
| tree | e571607fed769b3b6fd3e0bd99d1daac7d193ebe /src/include/access/tupdesc.h | |
| parent | 9247b29228c05e1e368c14d339fcbabeb27b426b (diff) | |
| download | postgresql-5a8820efcd9ae853de8ae711412218c7059d3358.tar.gz | |
Moved from backend/access to include/access
Diffstat (limited to 'src/include/access/tupdesc.h')
| -rw-r--r-- | src/include/access/tupdesc.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h new file mode 100644 index 0000000000..75945b625d --- /dev/null +++ b/src/include/access/tupdesc.h @@ -0,0 +1,53 @@ +/*------------------------------------------------------------------------- + * + * tupdesc.h-- + * POSTGRES tuple descriptor definitions. + * + * + * Copyright (c) 1994, Regents of the University of California + * + * $Id: tupdesc.h,v 1.1 1996/08/27 21:50:26 scrappy Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef TUPDESC_H +#define TUPDESC_H + +#include "postgres.h" +#include "access/attnum.h" +#include "nodes/pg_list.h" /* for List */ +#include "catalog/pg_attribute.h" + +/* + * a TupleDesc is an array of AttributeTupleForms, each of which is a + * pointer to a AttributeTupleForm + */ +/* typedef AttributeTupleForm *TupleDesc; */ + +/* a TupleDesc is a pointer to a structure which includes an array of */ +/* AttributeTupleForms, i.e. pg_attribute information, and the size of */ +/* the array, i.e. the number of attributes */ +/* in short, a TupleDesc completely captures the attribute information */ +/* for a tuple */ + +typedef struct tupleDesc { + int natts; + AttributeTupleForm *attrs; +} *TupleDesc; + +extern TupleDesc CreateTemplateTupleDesc(int natts); + +extern TupleDesc CreateTupleDesc(int natts, AttributeTupleForm *attrs); + +extern TupleDesc CreateTupleDescCopy(TupleDesc tupdesc); + +extern bool TupleDescInitEntry(TupleDesc desc, + AttrNumber attributeNumber, + char *attributeName, + char *typeName, + int attdim, + bool attisset); + +extern TupleDesc BuildDescForRelation(List *schema, char *relname); + +#endif /* TUPDESC_H */ |
