PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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-2026, 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" /* IWYU pragma: export */
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 */
32
34{
35 Oid oid; /* oid */
36 Oid enumtypid BKI_LOOKUP(pg_type); /* OID of owning enum type */
37 float4 enumsortorder; /* sort position of this enum value */
38 NameData enumlabel; /* text representation of enum value */
40
42
43/* ----------------
44 * Form_pg_enum corresponds to a pointer to a tuple with
45 * the format of pg_enum relation.
46 * ----------------
47 */
49
53
56
57/*
58 * prototypes for functions in pg_enum.c
59 */
60extern void EnumValuesCreate(Oid enumTypeOid, List *vals);
62extern void AddEnumLabel(Oid enumTypeOid, const char *newVal,
63 const char *neighbor, bool newValIsAfter,
64 bool skipIfExists);
66 const char *oldVal, const char *newVal);
67extern bool EnumUncommitted(Oid enum_id);
69extern void SerializeUncommittedEnums(void *space, Size size);
70extern void RestoreUncommittedEnums(void *space);
71extern void AtEOXact_Enum(void);
72
73#endif /* PG_ENUM_H */
float float4
Definition c.h:655
size_t Size
Definition c.h:631
#define BEGIN_CATALOG_STRUCT
Definition genbki.h:37
#define DECLARE_UNIQUE_INDEX_PKEY(name, oid, oidmacro, tblname, decl)
Definition genbki.h:105
#define BKI_LOOKUP(catalog)
Definition genbki.h:65
#define END_CATALOG_STRUCT
Definition genbki.h:38
#define DECLARE_UNIQUE_INDEX(name, oid, oidmacro, tblname, decl)
Definition genbki.h:104
#define CATALOG(name, oid, oidmacro)
Definition genbki.h:42
#define MAKE_SYSCACHE(name, idxname, nbuckets)
Definition genbki.h:146
void RestoreUncommittedEnums(void *space)
Definition pg_enum.c:886
void RenameEnumLabel(Oid enumTypeOid, const char *oldVal, const char *newVal)
Definition pg_enum.c:620
Size EstimateUncommittedEnumsSpace(void)
Definition pg_enum.c:826
bool EnumUncommitted(Oid enum_id)
Definition pg_enum.c:721
void EnumValuesDelete(Oid enumTypeOid)
Definition pg_enum.c:237
void AddEnumLabel(Oid enumTypeOid, const char *newVal, const char *neighbor, bool newValIsAfter, bool skipIfExists)
Definition pg_enum.c:305
void SerializeUncommittedEnums(void *space, Size size)
Definition pg_enum.c:840
void AtEOXact_Enum(void)
Definition pg_enum.c:739
END_CATALOG_STRUCT typedef FormData_pg_enum * Form_pg_enum
Definition pg_enum.h:48
FormData_pg_enum
Definition pg_enum.h:39
void EnumValuesCreate(Oid enumTypeOid, List *vals)
Definition pg_enum.c:84
unsigned int Oid
static int fb(int x)
Definition pg_list.h:54
Definition c.h:772