PostgreSQL Source Code  git master
pg_enum.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_enum.h
4  * definition of the "enum" system catalog (pg_enum)
5  *
6  *
7  * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/catalog/pg_enum.h
11  *
12  * NOTES
13  * The Catalog.pm module reads this file and derives schema
14  * information.
15  *
16  *-------------------------------------------------------------------------
17  */
18 #ifndef PG_ENUM_H
19 #define PG_ENUM_H
20 
21 #include "catalog/genbki.h"
22 #include "catalog/pg_enum_d.h"
23 
24 #include "nodes/pg_list.h"
25 
26 /* ----------------
27  * pg_enum definition. cpp turns this into
28  * typedef struct FormData_pg_enum
29  * ----------------
30  */
31 CATALOG(pg_enum,3501,EnumRelationId)
32 {
33  Oid enumtypid; /* OID of owning enum type */
34  float4 enumsortorder; /* sort position of this enum value */
35  NameData enumlabel; /* text representation of enum value */
37 
38 /* ----------------
39  * Form_pg_enum corresponds to a pointer to a tuple with
40  * the format of pg_enum relation.
41  * ----------------
42  */
44 
45 /*
46  * prototypes for functions in pg_enum.c
47  */
48 extern void EnumValuesCreate(Oid enumTypeOid, List *vals);
49 extern void EnumValuesDelete(Oid enumTypeOid);
50 extern void AddEnumLabel(Oid enumTypeOid, const char *newVal,
51  const char *neighbor, bool newValIsAfter,
52  bool skipIfExists);
53 extern void RenameEnumLabel(Oid enumTypeOid,
54  const char *oldVal, const char *newVal);
55 
56 #endif /* PG_ENUM_H */
void RenameEnumLabel(Oid enumTypeOid, const char *oldVal, const char *newVal)
Definition: pg_enum.c:471
void EnumValuesCreate(Oid enumTypeOid, List *vals)
Definition: pg_enum.c:49
unsigned int Oid
Definition: postgres_ext.h:31
void AddEnumLabel(Oid enumTypeOid, const char *newVal, const char *neighbor, bool newValIsAfter, bool skipIfExists)
Definition: pg_enum.c:179
void EnumValuesDelete(Oid enumTypeOid)
Definition: pg_enum.c:144
Definition: c.h:570
FormData_pg_enum * Form_pg_enum
Definition: pg_enum.h:43
FormData_pg_enum
Definition: pg_enum.h:36
float float4
Definition: c.h:457
Definition: pg_list.h:45
CATALOG(pg_enum, 3501, EnumRelationId)
Definition: pg_enum.h:31