pg_description.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_description.h
  4. * definition of the system "description" relation (pg_description)
  5. *
  6. * NOTE: an object is identified by the OID of the row that primarily
  7. * defines the object, plus the OID of the table that that row appears in.
  8. * For example, a function is identified by the OID of its pg_proc row
  9. * plus the pg_class OID of table pg_proc. This allows unique identification
  10. * of objects without assuming that OIDs are unique across tables.
  11. *
  12. * Since attributes don't have OIDs of their own, we identify an attribute
  13. * comment by the objoid+classoid of its parent table, plus an "objsubid"
  14. * giving the attribute column number. "objsubid" must be zero in a comment
  15. * for a table itself, so that it is distinct from any column comment.
  16. * Currently, objsubid is unused and zero for all other kinds of objects,
  17. * but perhaps it might be useful someday to associate comments with
  18. * constituent elements of other kinds of objects (arguments of a function,
  19. * for example).
  20. *
  21. *
  22. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  23. * Portions Copyright (c) 1994, Regents of the University of California
  24. *
  25. * src/include/catalog/pg_description.h
  26. *
  27. * NOTES
  28. * the genbki.pl script reads this file and generates .bki
  29. * information from the DATA() statements.
  30. *
  31. * XXX do NOT break up DATA() statements into multiple lines!
  32. * the scripts are not as smart as you might think...
  33. *
  34. *-------------------------------------------------------------------------
  35. */
  36. #ifndef PG_DESCRIPTION_H
  37. #define PG_DESCRIPTION_H
  38. #include "catalog/genbki.h"
  39. /* ----------------
  40. * pg_description definition. cpp turns this into
  41. * typedef struct FormData_pg_description
  42. * ----------------
  43. */
  44. #define DescriptionRelationId 2609
  45. CATALOG(pg_description,2609) BKI_WITHOUT_OIDS
  46. {
  47. Oid objoid; /* OID of object itself */
  48. Oid classoid; /* OID of table containing object */
  49. int32 objsubid; /* column number, or 0 if not used */
  50. #ifdef CATALOG_VARLEN /* variable-length fields start here */
  51. text description BKI_FORCE_NOT_NULL; /* description of object */
  52. #endif
  53. } FormData_pg_description;
  54. /* ----------------
  55. * Form_pg_description corresponds to a pointer to a tuple with
  56. * the format of pg_description relation.
  57. * ----------------
  58. */
  59. typedef FormData_pg_description *Form_pg_description;
  60. /* ----------------
  61. * compiler constants for pg_description
  62. * ----------------
  63. */
  64. #define Natts_pg_description 4
  65. #define Anum_pg_description_objoid 1
  66. #define Anum_pg_description_classoid 2
  67. #define Anum_pg_description_objsubid 3
  68. #define Anum_pg_description_description 4
  69. /* ----------------
  70. * initial contents of pg_description
  71. * ----------------
  72. */
  73. /*
  74. * Because the contents of this table are taken from the other *.h files,
  75. * there is no initialization here. The initial contents are extracted
  76. * by genbki.pl and loaded during initdb.
  77. */
  78. #endif /* PG_DESCRIPTION_H */