2007-04-02 05:49:42 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* pg_enum.h
|
|
|
|
* definition of the system "enum" relation (pg_enum)
|
|
|
|
* along with the relation's initial contents.
|
|
|
|
*
|
|
|
|
*
|
2012-01-02 00:01:58 +01:00
|
|
|
* Copyright (c) 2006-2012, PostgreSQL Global Development Group
|
2007-04-02 05:49:42 +02:00
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/catalog/pg_enum.h
|
2007-04-02 05:49:42 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
2010-01-05 02:06:57 +01:00
|
|
|
* the genbki.pl script reads this file and generates .bki
|
2007-04-02 05:49:42 +02:00
|
|
|
* information from the DATA() statements.
|
|
|
|
*
|
|
|
|
* XXX do NOT break up DATA() statements into multiple lines!
|
|
|
|
* the scripts are not as smart as you might think...
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PG_ENUM_H
|
|
|
|
#define PG_ENUM_H
|
|
|
|
|
2008-03-27 04:57:34 +01:00
|
|
|
#include "catalog/genbki.h"
|
2007-04-02 05:49:42 +02:00
|
|
|
#include "nodes/pg_list.h"
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* pg_enum definition. cpp turns this into
|
|
|
|
* typedef struct FormData_pg_enum
|
|
|
|
* ----------------
|
|
|
|
*/
|
2007-11-15 22:14:46 +01:00
|
|
|
#define EnumRelationId 3501
|
2007-04-02 05:49:42 +02:00
|
|
|
|
|
|
|
CATALOG(pg_enum,3501)
|
|
|
|
{
|
|
|
|
Oid enumtypid; /* OID of owning enum type */
|
2010-10-25 05:04:37 +02:00
|
|
|
float4 enumsortorder; /* sort position of this enum value */
|
2007-04-02 05:49:42 +02:00
|
|
|
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;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* compiler constants for pg_enum
|
|
|
|
* ----------------
|
|
|
|
*/
|
2010-10-25 05:04:37 +02:00
|
|
|
#define Natts_pg_enum 3
|
2007-04-02 05:49:42 +02:00
|
|
|
#define Anum_pg_enum_enumtypid 1
|
2010-10-25 05:04:37 +02:00
|
|
|
#define Anum_pg_enum_enumsortorder 2
|
|
|
|
#define Anum_pg_enum_enumlabel 3
|
2007-04-02 05:49:42 +02:00
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* pg_enum has no initial contents
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* prototypes for functions in pg_enum.c
|
|
|
|
*/
|
2010-10-25 05:04:37 +02:00
|
|
|
extern void EnumValuesCreate(Oid enumTypeOid, List *vals);
|
2007-04-02 05:49:42 +02:00
|
|
|
extern void EnumValuesDelete(Oid enumTypeOid);
|
2010-10-25 05:04:37 +02:00
|
|
|
extern void AddEnumLabel(Oid enumTypeOid, const char *newVal,
|
2011-04-10 17:42:00 +02:00
|
|
|
const char *neighbor, bool newValIsAfter);
|
2007-04-02 05:49:42 +02:00
|
|
|
|
|
|
|
#endif /* PG_ENUM_H */
|