00001 /*------------------------------------------------------------------------- 00002 * 00003 * pg_enum.h 00004 * definition of the system "enum" relation (pg_enum) 00005 * along with the relation's initial contents. 00006 * 00007 * 00008 * Copyright (c) 2006-2013, PostgreSQL Global Development Group 00009 * 00010 * src/include/catalog/pg_enum.h 00011 * 00012 * NOTES 00013 * the genbki.pl script reads this file and generates .bki 00014 * information from the DATA() statements. 00015 * 00016 * XXX do NOT break up DATA() statements into multiple lines! 00017 * the scripts are not as smart as you might think... 00018 * 00019 *------------------------------------------------------------------------- 00020 */ 00021 #ifndef PG_ENUM_H 00022 #define PG_ENUM_H 00023 00024 #include "catalog/genbki.h" 00025 #include "nodes/pg_list.h" 00026 00027 /* ---------------- 00028 * pg_enum definition. cpp turns this into 00029 * typedef struct FormData_pg_enum 00030 * ---------------- 00031 */ 00032 #define EnumRelationId 3501 00033 00034 CATALOG(pg_enum,3501) 00035 { 00036 Oid enumtypid; /* OID of owning enum type */ 00037 float4 enumsortorder; /* sort position of this enum value */ 00038 NameData enumlabel; /* text representation of enum value */ 00039 } FormData_pg_enum; 00040 00041 /* ---------------- 00042 * Form_pg_enum corresponds to a pointer to a tuple with 00043 * the format of pg_enum relation. 00044 * ---------------- 00045 */ 00046 typedef FormData_pg_enum *Form_pg_enum; 00047 00048 /* ---------------- 00049 * compiler constants for pg_enum 00050 * ---------------- 00051 */ 00052 #define Natts_pg_enum 3 00053 #define Anum_pg_enum_enumtypid 1 00054 #define Anum_pg_enum_enumsortorder 2 00055 #define Anum_pg_enum_enumlabel 3 00056 00057 /* ---------------- 00058 * pg_enum has no initial contents 00059 * ---------------- 00060 */ 00061 00062 /* 00063 * prototypes for functions in pg_enum.c 00064 */ 00065 extern void EnumValuesCreate(Oid enumTypeOid, List *vals); 00066 extern void EnumValuesDelete(Oid enumTypeOid); 00067 extern void AddEnumLabel(Oid enumTypeOid, const char *newVal, 00068 const char *neighbor, bool newValIsAfter, 00069 bool skipIfExists); 00070 00071 #endif /* PG_ENUM_H */