mirror of
https://github.com/postgres/postgres.git
synced 2026-03-13 22:28:01 -04:00
Traditionally, include/catalog/pg_foo.h contains extern declarations
for functions in backend/catalog/pg_foo.c, in addition to its function
as the authoritative definition of the pg_foo catalog's rowtype.
In some cases, we'd been forced to split out those extern declarations
into separate pg_foo_fn.h headers so that the catalog definitions
could be #include'd by frontend code. That problem is gone as of
commit 9c0a0de4c, so let's undo the splits to make things less
confusing.
Discussion: https://postgr.es/m/23690.1523031777@sss.pgh.pa.us
55 lines
1.5 KiB
C
55 lines
1.5 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* pg_enum.h
|
|
* definition of the system "enum" relation (pg_enum)
|
|
*
|
|
*
|
|
* Copyright (c) 2006-2018, PostgreSQL Global Development Group
|
|
*
|
|
* src/include/catalog/pg_enum.h
|
|
*
|
|
* NOTES
|
|
* The Catalog.pm module reads this file and derives schema
|
|
* information.
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PG_ENUM_H
|
|
#define PG_ENUM_H
|
|
|
|
#include "catalog/genbki.h"
|
|
#include "catalog/pg_enum_d.h"
|
|
|
|
#include "nodes/pg_list.h"
|
|
|
|
/* ----------------
|
|
* pg_enum definition. cpp turns this into
|
|
* typedef struct FormData_pg_enum
|
|
* ----------------
|
|
*/
|
|
CATALOG(pg_enum,3501,EnumRelationId)
|
|
{
|
|
Oid enumtypid; /* OID of owning enum type */
|
|
float4 enumsortorder; /* sort position of this enum value */
|
|
NameData enumlabel; /* text representation of enum value */
|
|
} FormData_pg_enum;
|
|
|
|
/* ----------------
|
|
* Form_pg_enum corresponds to a pointer to a tuple with
|
|
* the format of pg_enum relation.
|
|
* ----------------
|
|
*/
|
|
typedef FormData_pg_enum *Form_pg_enum;
|
|
|
|
/*
|
|
* prototypes for functions in pg_enum.c
|
|
*/
|
|
extern void EnumValuesCreate(Oid enumTypeOid, List *vals);
|
|
extern void EnumValuesDelete(Oid enumTypeOid);
|
|
extern void AddEnumLabel(Oid enumTypeOid, const char *newVal,
|
|
const char *neighbor, bool newValIsAfter,
|
|
bool skipIfExists);
|
|
extern void RenameEnumLabel(Oid enumTypeOid,
|
|
const char *oldVal, const char *newVal);
|
|
|
|
#endif /* PG_ENUM_H */
|