pg_enum.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_enum.h
  4. * definition of the system "enum" relation (pg_enum)
  5. * along with the relation's initial contents.
  6. *
  7. *
  8. * Copyright (c) 2006-2016, PostgreSQL Global Development Group
  9. *
  10. * src/include/catalog/pg_enum.h
  11. *
  12. * NOTES
  13. * the genbki.pl script reads this file and generates .bki
  14. * information from the DATA() statements.
  15. *
  16. * XXX do NOT break up DATA() statements into multiple lines!
  17. * the scripts are not as smart as you might think...
  18. *
  19. *-------------------------------------------------------------------------
  20. */
  21. #ifndef PG_ENUM_H
  22. #define PG_ENUM_H
  23. #include "catalog/genbki.h"
  24. #include "nodes/pg_list.h"
  25. /* ----------------
  26. * pg_enum definition. cpp turns this into
  27. * typedef struct FormData_pg_enum
  28. * ----------------
  29. */
  30. #define EnumRelationId 3501
  31. CATALOG(pg_enum,3501)
  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 */
  36. } FormData_pg_enum;
  37. /* ----------------
  38. * Form_pg_enum corresponds to a pointer to a tuple with
  39. * the format of pg_enum relation.
  40. * ----------------
  41. */
  42. typedef FormData_pg_enum *Form_pg_enum;
  43. /* ----------------
  44. * compiler constants for pg_enum
  45. * ----------------
  46. */
  47. #define Natts_pg_enum 3
  48. #define Anum_pg_enum_enumtypid 1
  49. #define Anum_pg_enum_enumsortorder 2
  50. #define Anum_pg_enum_enumlabel 3
  51. /* ----------------
  52. * pg_enum has no initial contents
  53. * ----------------
  54. */
  55. /*
  56. * prototypes for functions in pg_enum.c
  57. */
  58. extern void EnumValuesCreate(Oid enumTypeOid, List *vals);
  59. extern void EnumValuesDelete(Oid enumTypeOid);
  60. extern void AddEnumLabel(Oid enumTypeOid, const char *newVal,
  61. const char *neighbor, bool newValIsAfter,
  62. bool skipIfExists);
  63. #endif /* PG_ENUM_H */